diff options
Diffstat (limited to 'kernel/kexec.c')
-rw-r--r-- | kernel/kexec.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c index 58f0f382597c..50087ecf337e 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -1042,7 +1042,6 @@ asmlinkage long compat_sys_kexec_load(unsigned long entry, | |||
1042 | 1042 | ||
1043 | void crash_kexec(struct pt_regs *regs) | 1043 | void crash_kexec(struct pt_regs *regs) |
1044 | { | 1044 | { |
1045 | struct kimage *image; | ||
1046 | int locked; | 1045 | int locked; |
1047 | 1046 | ||
1048 | 1047 | ||
@@ -1056,12 +1055,11 @@ void crash_kexec(struct pt_regs *regs) | |||
1056 | */ | 1055 | */ |
1057 | locked = xchg(&kexec_lock, 1); | 1056 | locked = xchg(&kexec_lock, 1); |
1058 | if (!locked) { | 1057 | if (!locked) { |
1059 | image = xchg(&kexec_crash_image, NULL); | 1058 | if (kexec_crash_image) { |
1060 | if (image) { | ||
1061 | struct pt_regs fixed_regs; | 1059 | struct pt_regs fixed_regs; |
1062 | crash_setup_regs(&fixed_regs, regs); | 1060 | crash_setup_regs(&fixed_regs, regs); |
1063 | machine_crash_shutdown(&fixed_regs); | 1061 | machine_crash_shutdown(&fixed_regs); |
1064 | machine_kexec(image); | 1062 | machine_kexec(kexec_crash_image); |
1065 | } | 1063 | } |
1066 | xchg(&kexec_lock, 0); | 1064 | xchg(&kexec_lock, 0); |
1067 | } | 1065 | } |