Skip to content

Commit

Permalink
kexec: set KEXEC_TYPE_CRASH before sanity_check_segment_list()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Dave Young <[email protected]>
Cc: Eric Biederman <[email protected]>
Cc: Vivek Goyal <[email protected]>
Acked-by: Baoquan He <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Xunlei Pang authored and torvalds committed Jan 21, 2016
1 parent 9425676 commit cdf4b3f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions kernel/kexec.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ static int kimage_alloc_init(struct kimage **rimage, unsigned long entry,
if (ret)
goto out_free_image;

ret = sanity_check_segment_list(image);
if (ret)
goto out_free_image;

/* Enable the special crash kernel control page allocation policy. */
if (kexec_on_panic) {
/* Enable special crash kernel control page alloc policy. */
image->control_page = crashk_res.start;
image->type = KEXEC_TYPE_CRASH;
}

ret = sanity_check_segment_list(image);
if (ret)
goto out_free_image;

/*
* Find a location for the control code buffer, and add it
* the vector of segments so that it's pages will also be
Expand Down

0 comments on commit cdf4b3f

Please sign in to comment.