History

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.

Vitaly Mayatskikh committed 16 years ago

Commit 475f9aa1 parent d586ebb1 file · +2 −4Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/kexec.c+2−4
@@ -1134,11 +1134,9 @@ int crash_shrink_memory(unsigned long new_size) · 1133 unmodified lines
11341134
11351135 free_reserved_phys_range(end, crashk_res.end);
11361136
1137− if (start == end) {
1138− crashk_res.end = end;
1137+ if (start == end)
11391138 release_resource(&crashk_res);
1140− } else
1141− crashk_res.end = end - 1;
1139+ crashk_res.end = end - 1;
11421140
11431141 unlock:
11441142 mutex_unlock(&kexec_mutex);