aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorVivek Goyal <[email protected]>2014-08-08 14:26:06 -0700
committerLinus Torvalds <[email protected]>2014-08-08 15:57:33 -0700
commit27f48d3e633be23656a097baa3be336e04a82d84 (patch)
tree8933767497b417ee532f63b9582734743eed8e41 /kernel
parent12db5562e0352986a265841638482b84f3a6899b (diff)
kexec-bzImage64: support for loading bzImage using 64bit entry
This is loader specific code which can load bzImage and set it up for 64bit entry. This does not take care of 32bit entry or real mode entry. 32bit mode entry can be implemented if somebody needs it. Signed-off-by: Vivek Goyal <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Michael Kerrisk <[email protected]> Cc: Yinghai Lu <[email protected]> Cc: Eric Biederman <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Matthew Garrett <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Dave Young <[email protected]> Cc: WANG Chao <[email protected]> Cc: Baoquan He <[email protected]> Cc: Andy Lutomirski <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/kexec.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/kexec.c b/kernel/kexec.c
index 669e331aa9ec..0926f2a3ed03 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -460,6 +460,14 @@ static void kimage_file_post_load_cleanup(struct kimage *image)
/* See if architecture has anything to cleanup post load */
arch_kimage_file_post_load_cleanup(image);
+
+ /*
+ * Above call should have called into bootloader to free up
+ * any data stored in kimage->image_loader_data. It should
+ * be ok now to free it up.
+ */
+ kfree(image->image_loader_data);
+ image->image_loader_data = NULL;
}
/*
@@ -576,7 +584,6 @@ out_free_control_pages:
kimage_free_page_list(&image->control_pages);
out_free_post_load_bufs:
kimage_file_post_load_cleanup(image);
- kfree(image->image_loader_data);
out_free_image:
kfree(image);
return ret;
@@ -900,8 +907,6 @@ static void kimage_free(struct kimage *image)
/* Free the kexec control pages... */
kimage_free_page_list(&image->control_pages);
- kfree(image->image_loader_data);
-
/*
* Free up any temporary buffers allocated. This might hit if
* error occurred much later after buffer allocation.