* [PATCH] tty: hvc: fix return value of __setup handler
@ 2022-03-08 2:42 Randy Dunlap
0 siblings, 0 replies; only message in thread
From: Randy Dunlap @ 2022-03-08 2:42 UTC (permalink / raw)
To: linux-kernel
Cc: Randy Dunlap, Vasily Gorbik, Greg Kroah-Hartman, Jingoo Han,
Julian Wiedmann, patches, Igor Zhbanov, linuxppc-dev, Jiri Slaby
__setup() handlers should return 1 to indicate that the boot option
has been handled or 0 to indicate that it was not handled.
Add a pr_warn() message if the option value is invalid and then
always return 1.
Fixes: 86b40567b917 ("tty: replace strict_strtoul() with kstrtoul()")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Reported-by: Igor Zhbanov <i.zhbanov@omprussia.ru>
Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@omprussia.ru
Cc: Jingoo Han <jg1.han@samsung.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jirislaby@kernel.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Julian Wiedmann <jwi@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org
---
drivers/tty/hvc/hvc_iucv.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- linux-next-20220307.orig/drivers/tty/hvc/hvc_iucv.c
+++ linux-next-20220307/drivers/tty/hvc/hvc_iucv.c
@@ -1417,7 +1417,9 @@ out_error:
*/
static int __init hvc_iucv_config(char *val)
{
- return kstrtoul(val, 10, &hvc_iucv_devices);
+ if (kstrtoul(val, 10, &hvc_iucv_devices))
+ pr_warn("hvc_iucv= invalid parameter value '%s'\n", val);
+ return 1;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-03-08 2:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-08 2:42 [PATCH] tty: hvc: fix return value of __setup handler Randy Dunlap
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).