[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <87iq7n8toc.wl%vmayatsk@redhat.com>
Date: Mon, 19 Apr 2010 15:21:07 +0200
From: Vitaly Mayatskikh <v.mayatskih@...il.com>
To: linux-kernel <linux-kernel@...r.kernel.org>
Cc: Amerigo Wang <amwang@...hat.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Neil Horman <nhorman@...driver.com>
Subject: 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 patch fixes it.
Signed-off-by: Vitaly Mayatskikh <v.mayatskih@...il.com>
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 87ebe8a..474a847 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -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);
--
wbr, Vitaly
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists