diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2019-08-16 15:49:49 +0200 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2019-08-26 12:51:17 +0200 |
commit | 915ef7bda76466a5542a76694c08709895383f1c (patch) | |
tree | c8b6ddc0998035be3f36d4969abdce5d62321182 /arch/s390/numa/mode_emu.c | |
parent | 416f79c23dbe47e0e223efc06d3487e1d90a92ee (diff) |
s390/numa: correct early_param handling
When command line options are used without specifying values
(e.g. "emu_size" instead of "emu_size="), the value is NULL. Check that
before performing string operations and further processing.
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/numa/mode_emu.c')
-rw-r--r-- | arch/s390/numa/mode_emu.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/s390/numa/mode_emu.c b/arch/s390/numa/mode_emu.c index 71a12a4f4906..72d742bb2d17 100644 --- a/arch/s390/numa/mode_emu.c +++ b/arch/s390/numa/mode_emu.c @@ -558,9 +558,7 @@ static int __init early_parse_emu_nodes(char *p) { int count; - if (kstrtoint(p, 0, &count) != 0 || count <= 0) - return 0; - if (count <= 0) + if (!p || kstrtoint(p, 0, &count) != 0 || count <= 0) return 0; emu_nodes = min(count, MAX_NUMNODES); return 0; @@ -572,7 +570,8 @@ early_param("emu_nodes", early_parse_emu_nodes); */ static int __init early_parse_emu_size(char *p) { - emu_size = memparse(p, NULL); + if (p) + emu_size = memparse(p, NULL); return 0; } early_param("emu_size", early_parse_emu_size); |