[PATCH] makedumpfile: Improve error handing when SIZE(nodemask_t) is undefined

Bernhard Walle bwalle at suse.de
Wed Jul 9 07:48:01 EDT 2008


Hi,

I accidentally used a new makedumpfile with an old VMCOREINFO that did
not contain the SIZE(nodemask_t). Then len was -1, and malloc(-1)
failed. Which looked like memory was too low.

This patch just improves the error message in that case so that the
user knows what is wrong.


Signed-off-by: Bernhard Walle <bwalle at suse.de>

---
 makedumpfile.c |    5 +++++
 1 file changed, 5 insertions(+)

diff -u -r1.7.2.37 makedumpfile.c
--- makedumpfile.c	9 Jul 2008 00:22:09 -0000	1.7.2.37
+++ makedumpfile.c	9 Jul 2008 11:39:43 -0000
@@ -2580,6 +2580,11 @@
 	    && (SYMBOL(node_states) == NOT_FOUND_SYMBOL))
 		return 0;

+	if (SIZE(nodemask_t) == NOT_FOUND_LONG_VALUE) {
+		ERRMSG("SIZE(nodemask_t) undefined.\n");
+		return 0;
+	}
+
 	len = SIZE(nodemask_t);
 	vt.node_online_map_len = len/sizeof(unsigned long);
 	if (!(vt.node_online_map = (unsigned long *)malloc(len))) {



More information about the kexec mailing list