Skip to content

Commit cdf4b3f

Browse files
Xunlei Pangtorvalds
authored andcommitted
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>
1 parent 9425676 commit cdf4b3f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

‎kernel/kexec.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ static int kimage_alloc_init(struct kimage **rimage, unsigned long entry,
6363
if (ret)
6464
goto out_free_image;
6565

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. */
7166
if (kexec_on_panic) {
67+
/* Enable special crash kernel control page alloc policy. */
7268
image->control_page = crashk_res.start;
7369
image->type = KEXEC_TYPE_CRASH;
7470
}
7571

72+
ret = sanity_check_segment_list(image);
73+
if (ret)
74+
goto out_free_image;
75+
7676
/*
7777
* Find a location for the control code buffer, and add it
7878
* the vector of segments so that it's pages will also be

0 commit comments

Comments
 (0)