summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2014-07-23 09:13:09 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2014-07-28 20:51:15 +1000
commit88b9cdad67abc4ae2bab5c052efb25a5855ea4af (patch)
treebf16d15d0be626c32735c933f6709dc4f033b027 /arch
parent6239064dc77ca5b55537922d6217ab2451c3680a (diff)
kexec: fix freeing up for image loader data loading
During testing I noticed a crash. Which in turn showed that there are problems with how I am freeing up image->image_loader_data. In one case I am freeing up kimage->image_loader_data first and then calling up arch to free up which might have been contained in that structure. That's wrong. I have done little cleanup and this should fix the issues around freeing up of loader data. Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/kexec-bzimage64.c4
-rw-r--r--arch/x86/kernel/machine_kexec_64.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c
index 990bf279a56b..bcedd100192f 100644
--- a/arch/x86/kernel/kexec-bzimage64.c
+++ b/arch/x86/kernel/kexec-bzimage64.c
@@ -355,9 +355,9 @@ out_free_params:
}
/* This cleanup function is called after various segments have been loaded */
-int bzImage64_cleanup(struct kimage *image)
+int bzImage64_cleanup(void *loader_data)
{
- struct bzimage64_data *ldata = image->image_loader_data;
+ struct bzimage64_data *ldata = loader_data;
if (!ldata)
return 0;
diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c
index 87c6a9922286..18d0f9e0b6da 100644
--- a/arch/x86/kernel/machine_kexec_64.c
+++ b/arch/x86/kernel/machine_kexec_64.c
@@ -329,7 +329,7 @@ int arch_kimage_file_post_load_cleanup(struct kimage *image)
if (!image->fops || !image->fops->cleanup)
return 0;
- return image->fops->cleanup(image);
+ return image->fops->cleanup(image->image_loader_data);
}
/*