arm64: dts: ti: k3-j721e-beagleboneai64: Fixup reference to phandles array
[linux-2.6-block.git] / kernel / kexec.c
index cb8e6e6f983c7900e9950ed2e0b719ff4a524f03..92d301f98776642ca2ba95cdabb7c6a1745c3b57 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 (!capable(CAP_SYS_BOOT) || kexec_load_disabled)
+       if (!kexec_load_permitted(image_type))
                return -EPERM;
 
        /* Permit LSMs and IMA to fail the kexec */