[LINUX] Kexec: Don't try to load an NULL image. This can occur when unloading.
authorIan Campbell <ian.campbell@xensource.com>
Tue, 9 Jan 2007 17:14:28 +0000 (17:14 +0000)
committerIan Campbell <ian.campbell@xensource.com>
Tue, 9 Jan 2007 17:14:28 +0000 (17:14 +0000)
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
linux-2.6-xen-sparse/kernel/kexec.c

index 9a1dbb6ae31208a075d0c53d5b0589baa36e9a6e..bb19157362c5f2b80e8c0504d607cf947dc108fa 100644 (file)
@@ -1012,9 +1012,11 @@ asmlinkage long sys_kexec_load(unsigned long entry, unsigned long nr_segments,
                        goto out;
        }
 #ifdef CONFIG_XEN
-       result = xen_machine_kexec_load(image);
-       if (result)
-               goto out;
+       if (image) {
+               result = xen_machine_kexec_load(image);
+               if (result)
+                       goto out;
+       }
 #endif
        /* Install the new kernel, and  Uninstall the old */
        image = xchg(dest_image, image);