mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 15:29:16 +00:00
kexec: fix OOPS in crash_kernel_shrink
Two "echo 0 > /sys/kernel/kexec_crash_size" OOPSes kernel. Also content of this file is invalid after first shrink to zero: it shows 1 instead of 0. This scenario is unlikely to happen often (root privs, valid crashkernel= in cmdline, dump-capture kernel not loaded), I hit it only by chance. This patch fixes it. Signed-off-by: Vitaly Mayatskikh <v.mayatskih@gmail.com> Cc: Cong Wang <amwang@redhat.com> Cc: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
d586ebbb88
commit
475f9aa6aa
@ -1134,10 +1134,8 @@ int crash_shrink_memory(unsigned long new_size)
|
|||||||
|
|
||||||
free_reserved_phys_range(end, crashk_res.end);
|
free_reserved_phys_range(end, crashk_res.end);
|
||||||
|
|
||||||
if (start == end) {
|
if (start == end)
|
||||||
crashk_res.end = end;
|
|
||||||
release_resource(&crashk_res);
|
release_resource(&crashk_res);
|
||||||
} else
|
|
||||||
crashk_res.end = end - 1;
|
crashk_res.end = end - 1;
|
||||||
|
|
||||||
unlock:
|
unlock:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user