Skip to content

Commit 2e5920b

Browse files
Zhen Leictmarinas
authored andcommitted
kdump: return -ENOENT if required cmdline option does not exist
According to the current crashkernel=Y,low support in other ARCHes, it's an optional command-line option. When it doesn't exist, kernel will try to allocate minimum required memory below 4G automatically. However, __parse_crashkernel() returns '-EINVAL' for all error cases. It can't distinguish the nonexistent option from invalid option. Change __parse_crashkernel() to return '-ENOENT' for the nonexistent option case. With this change, crashkernel,low memory will take the default value if crashkernel=,low is not specified; while crashkernel reservation will fail and bail out if an invalid option is specified. Signed-off-by: Zhen Lei <[email protected]> Acked-by: Baoquan He <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent b2d229d commit 2e5920b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

kernel/crash_core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,8 @@ static int __init __parse_crashkernel(char *cmdline,
243243
*crash_base = 0;
244244

245245
ck_cmdline = get_last_crashkernel(cmdline, name, suffix);
246-
247246
if (!ck_cmdline)
248-
return -EINVAL;
247+
return -ENOENT;
249248

250249
ck_cmdline += strlen(name);
251250

0 commit comments

Comments
 (0)