Skip to content

Commit

Permalink
s390/dasd: Fix a precision vs width bug in dasd_feature_list()
Browse files Browse the repository at this point in the history
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 <dan.carpenter@oracle.com>
Tested-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
  • Loading branch information
Dan Carpenter authored and Vasily Gorbik committed Jul 2, 2019
1 parent ebc3d17 commit 83eb1a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/s390/block/dasd_devmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 83eb1a4

Please sign in to comment.