diff options
author | Vasily Gorbik <gor@linux.ibm.com> | 2019-08-19 11:49:53 +0300 |
---|---|---|
committer | Vasily Gorbik <gor@linux.ibm.com> | 2019-08-26 13:51:17 +0300 |
commit | 227f52a43a2fa0bb50f07faa2d5e31530a740499 (patch) | |
tree | 9afdf5627f84c11f17e5d900de4287ce2e45ada1 /arch/s390/boot/ipl_parm.c | |
parent | a45425d8a5a672d3322164cfce10b7b6fb32fcc2 (diff) | |
download | linux-227f52a43a2fa0bb50f07faa2d5e31530a740499.tar.xz |
s390/startup: correct command line options parsing
Check val is not NULL before accessing it. This might happen if
corresponding kernel command line options are used without specifying
values.
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390/boot/ipl_parm.c')
-rw-r--r-- | arch/s390/boot/ipl_parm.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/s390/boot/ipl_parm.c b/arch/s390/boot/ipl_parm.c index 4a052a844f9b..80b8d8712f08 100644 --- a/arch/s390/boot/ipl_parm.c +++ b/arch/s390/boot/ipl_parm.c @@ -223,12 +223,12 @@ void parse_boot_command_line(void) while (*args) { args = next_arg(args, ¶m, &val); - if (!strcmp(param, "mem")) { + if (!strcmp(param, "mem") && val) { memory_end = round_down(memparse(val, NULL), PAGE_SIZE); memory_end_set = 1; } - if (!strcmp(param, "vmalloc")) + if (!strcmp(param, "vmalloc") && val) vmalloc_size = round_up(memparse(val, NULL), PAGE_SIZE); if (!strcmp(param, "noexec")) { @@ -237,7 +237,7 @@ void parse_boot_command_line(void) noexec_disabled = 1; } - if (!strcmp(param, "facilities")) + if (!strcmp(param, "facilities") && val) modify_fac_list(val); if (!strcmp(param, "nokaslr")) |