kexec: prevent double free on image allocation failure
[deliverable/linux.git] / kernel / kexec.c
index ea097ad7cc373832b805a5780a3e1114458f5131..855bfbbf4048699b827601c3f9e122a1f8df738c 100644 (file)
@@ -242,8 +242,6 @@ static int kimage_normal_alloc(struct kimage **rimage, unsigned long entry,
        if (result)
                goto out;
 
-       *rimage = image;
-
        /*
         * Find a location for the control code buffer, and add it
         * the vector of segments so that it's pages will also be
@@ -1537,6 +1535,9 @@ static int __init crash_save_vmcoreinfo_init(void)
        VMCOREINFO_NUMBER(PG_private);
        VMCOREINFO_NUMBER(PG_swapcache);
        VMCOREINFO_NUMBER(PG_slab);
+#ifdef CONFIG_MEMORY_FAILURE
+       VMCOREINFO_NUMBER(PG_hwpoison);
+#endif
        VMCOREINFO_NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE);
 
        arch_crash_save_vmcoreinfo();
This page took 0.03029 seconds and 5 git commands to generate.