diff options
author | Xunlei Pang <xlpang@redhat.com> | 2016-01-20 18:00:31 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-20 20:09:18 -0500 |
commit | cdf4b3fa03bab157d2d70d4de65bb7ae319b084f (patch) | |
tree | 3edd3c725d3d7ad46214529574d72e8623538dd6 /kernel/kexec.c | |
parent | 9425676a363c0976e3d43dda792dc4711a651d1d (diff) |
kexec: set KEXEC_TYPE_CRASH before sanity_check_segment_list()
sanity_check_segment_list() checks KEXEC_TYPE_CRASH flag to ensure all the
segments of the loaded crash kernel are within the kernel crash resource
limits, so set the flag beforehand.
Signed-off-by: Xunlei Pang <xlpang@redhat.com>
Acked-by: Dave Young <dyoung@redhat.com>
Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Vivek Goyal <vgoyal@redhat.com>
Acked-by: Baoquan He <bhe@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/kexec.c')
-rw-r--r-- | kernel/kexec.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c index d873b64fbddc..ee70aef5cd81 100644 --- a/kernel/kexec.c +++ b/kernel/kexec.c | |||
@@ -63,16 +63,16 @@ static int kimage_alloc_init(struct kimage **rimage, unsigned long entry, | |||
63 | if (ret) | 63 | if (ret) |
64 | goto out_free_image; | 64 | goto out_free_image; |
65 | 65 | ||
66 | ret = sanity_check_segment_list(image); | ||
67 | if (ret) | ||
68 | goto out_free_image; | ||
69 | |||
70 | /* Enable the special crash kernel control page allocation policy. */ | ||
71 | if (kexec_on_panic) { | 66 | if (kexec_on_panic) { |
67 | /* Enable special crash kernel control page alloc policy. */ | ||
72 | image->control_page = crashk_res.start; | 68 | image->control_page = crashk_res.start; |
73 | image->type = KEXEC_TYPE_CRASH; | 69 | image->type = KEXEC_TYPE_CRASH; |
74 | } | 70 | } |
75 | 71 | ||
72 | ret = sanity_check_segment_list(image); | ||
73 | if (ret) | ||
74 | goto out_free_image; | ||
75 | |||
76 | /* | 76 | /* |
77 | * Find a location for the control code buffer, and add it | 77 | * Find a location for the control code buffer, and add it |
78 | * the vector of segments so that it's pages will also be | 78 | * the vector of segments so that it's pages will also be |