kexec: introduce sysctl parameters kexec_load_limit_*
[linux-2.6-microblaze.git] / kernel / kexec.c
index ce1bca8..92d301f 100644 (file)
@@ -190,10 +190,12 @@ out_unlock:
 static inline int kexec_load_check(unsigned long nr_segments,
                                   unsigned long flags)
 {
+       int image_type = (flags & KEXEC_ON_CRASH) ?
+                        KEXEC_TYPE_CRASH : KEXEC_TYPE_DEFAULT;
        int result;
 
        /* We only trust the superuser with rebooting the system. */
-       if (!kexec_load_permitted())
+       if (!kexec_load_permitted(image_type))
                return -EPERM;
 
        /* Permit LSMs and IMA to fail the kexec */