From: Dan Carpenter Date: Wed, 26 Jun 2019 10:06:58 +0000 (+0300) Subject: s390/dasd: Fix a precision vs width bug in dasd_feature_list() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=83eb1a415023e6489bf5adb467f20156722172f0;p=linux.git s390/dasd: Fix a precision vs width bug in dasd_feature_list() The "len" variable is the length of the option up to the next option or to the end of the string which ever first. We want to print the invalid option so we want precision "%.*s" but the format is width "%*s" so it prints up to the end of the string. Signed-off-by: Dan Carpenter Tested-by: Stefan Haberland Signed-off-by: Stefan Haberland Signed-off-by: Vasily Gorbik --- diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index fab35c6170cc8..245f33c2f71e5 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c @@ -203,7 +203,7 @@ static int __init dasd_feature_list(char *str) else if (len == 8 && !strncmp(str, "failfast", 8)) features |= DASD_FEATURE_FAILFAST; else { - pr_warn("%*s is not a supported device option\n", + pr_warn("%.*s is not a supported device option\n", len, str); rc = -EINVAL; }