kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] s390/dasd: Fix a precision vs width bug in dasd_feature_list()
@ 2019-06-26 10:06 Dan Carpenter
  2019-06-27 14:14 ` Stefan Haberland
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2019-06-26 10:06 UTC (permalink / raw)
  To: Stefan Haberland
  Cc: Jan Hoeppner, Heiko Carstens, Vasily Gorbik,
	Christian Borntraeger, linux-s390, kernel-janitors

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>
---
Not tested.

 drivers/s390/block/dasd_devmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c
index fab35c6170cc..245f33c2f71e 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;
 		}
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] s390/dasd: Fix a precision vs width bug in dasd_feature_list()
  2019-06-26 10:06 [PATCH] s390/dasd: Fix a precision vs width bug in dasd_feature_list() Dan Carpenter
@ 2019-06-27 14:14 ` Stefan Haberland
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Haberland @ 2019-06-27 14:14 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Jan Hoeppner, Heiko Carstens, Vasily Gorbik,
	Christian Borntraeger, linux-s390, kernel-janitors

On 26.06.19 12:06, Dan Carpenter wrote:
> 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>
> ---
> Not tested.

Thanks for the patch. I tested it and it works as expected.
Will integrate it through the s390 tree.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-27 14:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-26 10:06 [PATCH] s390/dasd: Fix a precision vs width bug in dasd_feature_list() Dan Carpenter
2019-06-27 14:14 ` Stefan Haberland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).