diff options
Diffstat (limited to 'kernel/kexec.c')
-rw-r--r-- | kernel/kexec.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c index 474a84715eac..131b1703936f 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -1089,9 +1089,10 @@ void crash_kexec(struct pt_regs *regs) | |||
1089 | 1089 | ||
1090 | size_t crash_get_memory_size(void) | 1090 | size_t crash_get_memory_size(void) |
1091 | { | 1091 | { |
1092 | size_t size; | 1092 | size_t size = 0; |
1093 | mutex_lock(&kexec_mutex); | 1093 | mutex_lock(&kexec_mutex); |
1094 | size = crashk_res.end - crashk_res.start + 1; | 1094 | if (crashk_res.end != crashk_res.start) |
1095 | size = crashk_res.end - crashk_res.start + 1; | ||
1095 | mutex_unlock(&kexec_mutex); | 1096 | mutex_unlock(&kexec_mutex); |
1096 | return size; | 1097 | return size; |
1097 | } | 1098 | } |
@@ -1134,7 +1135,7 @@ int crash_shrink_memory(unsigned long new_size) | |||
1134 | 1135 | ||
1135 | free_reserved_phys_range(end, crashk_res.end); | 1136 | free_reserved_phys_range(end, crashk_res.end); |
1136 | 1137 | ||
1137 | if (start == end) | 1138 | if ((start == end) && (crashk_res.parent != NULL)) |
1138 | release_resource(&crashk_res); | 1139 | release_resource(&crashk_res); |
1139 | crashk_res.end = end - 1; | 1140 | crashk_res.end = end - 1; |
1140 | 1141 | ||