From 7838d5fd372942a190963796d9bcb4f72d6d68a7 Mon Sep 17 00:00:00 2001 From: Jingxian He Date: Tue, 22 Feb 2022 22:12:39 +0800 Subject: [PATCH] mm/pin_mem: add invalid check for pinmemory boot parameter euleros inclusion category: feature bugzilla:https://gitee.com/openeuler/kernel/issues/I4UCEQ CVE: NA ------------ When the pinmemory setting string is null, return directly without setting pinmemory addr. Signed-off-by: Jingxian He Reviewed-by: Kefeng Wang Signed-off-by: Zheng Zengkai --- mm/pin_mem.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mm/pin_mem.c b/mm/pin_mem.c index 34fe373c5fcc..d37938bcdc97 100644 --- a/mm/pin_mem.c +++ b/mm/pin_mem.c @@ -1092,9 +1092,12 @@ static int __init parse_pin_memory(char *cmdline) { char *cur = cmdline; + if (!cmdline) + return 0; + pin_mem_len = memparse(cmdline, &cur); if (cmdline == cur) { - pr_warn("crashkernel: memory value expected\n"); + pr_warn("pinmem: memory value expected\n"); return -EINVAL; } -- GitLab