Message ID | 20240729115252.1659112-1-ruanjinjie@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [v6,RESEND] crash: Fix crash memory reserve exceed system memory bug | expand |
diff --git a/kernel/crash_reserve.c b/kernel/crash_reserve.c index ad5b3f2c5487..5387269114f6 100644 --- a/kernel/crash_reserve.c +++ b/kernel/crash_reserve.c @@ -335,6 +335,9 @@ int __init parse_crashkernel(char *cmdline, if (!*crash_size) ret = -EINVAL; + if (*crash_size >= system_ram) + ret = -EINVAL; + return ret; }