[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220308024228.20477-1-rdunlap@infradead.org>
Date: Mon, 7 Mar 2022 18:42:28 -0800
From: Randy Dunlap <rdunlap@...radead.org>
To: linux-kernel@...r.kernel.org
Cc: patches@...ts.linux.dev, Randy Dunlap <rdunlap@...radead.org>,
Igor Zhbanov <i.zhbanov@...russia.ru>,
Jingoo Han <jg1.han@...sung.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>,
Michael Ellerman <mpe@...erman.id.au>,
Julian Wiedmann <jwi@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
linuxppc-dev@...ts.ozlabs.org
Subject: [PATCH] tty: hvc: fix return value of __setup handler
__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@...radead.org>
Reported-by: Igor Zhbanov <i.zhbanov@...russia.ru>
Link: lore.kernel.org/r/64644a2f-4a20-bab3-1e15-3b2cdd0defe3@...russia.ru
Cc: Jingoo Han <jg1.han@...sung.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Jiri Slaby <jirislaby@...nel.org>
Cc: Michael Ellerman <mpe@...erman.id.au>
Cc: Julian Wiedmann <jwi@...ux.ibm.com>
Cc: Vasily Gorbik <gor@...ux.ibm.com>
Cc: linuxppc-dev@...ts.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;
}
Powered by blists - more mailing lists