mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-12-02 17:00:37 -05: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 <[email protected]> Cc: Cong Wang <[email protected]> Cc: Neil Horman <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
d586ebbb88
commit
475f9aa6aa
1 changed files with 2 additions and 4 deletions
|
|
@ -1134,11 +1134,9 @@ int crash_shrink_memory(unsigned long new_size)
|
|||
|
||||
free_reserved_phys_range(end, crashk_res.end);
|
||||
|
||||
if (start == end) {
|
||||
crashk_res.end = end;
|
||||
if (start == end)
|
||||
release_resource(&crashk_res);
|
||||
} else
|
||||
crashk_res.end = end - 1;
|
||||
crashk_res.end = end - 1;
|
||||
|
||||
unlock:
|
||||
mutex_unlock(&kexec_mutex);
|
||||
|
|
|
|||
Loading…
Reference in a new issue