From: Vasily Gorbik Date: Mon, 19 Aug 2019 08:49:53 +0000 (+0200) Subject: s390/startup: correct command line options parsing X-Git-Tag: v5.15~5531^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=227f52a43a2fa0bb50f07faa2d5e31530a740499;p=platform%2Fkernel%2Flinux-starfive.git 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 --- diff --git a/arch/s390/boot/ipl_parm.c b/arch/s390/boot/ipl_parm.c index 4a052a8..80b8d871 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"))