diff options
Diffstat (limited to 'fs/proc')
-rw-r--r-- | fs/proc/kcore.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index 70733780fdd9..3d0485c361c7 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c | |||
@@ -107,6 +107,8 @@ static void free_kclist_ents(struct list_head *head) | |||
107 | */ | 107 | */ |
108 | static void __kcore_update_ram(struct list_head *list) | 108 | static void __kcore_update_ram(struct list_head *list) |
109 | { | 109 | { |
110 | int nphdr; | ||
111 | size_t size; | ||
110 | struct kcore_list *tmp, *pos; | 112 | struct kcore_list *tmp, *pos; |
111 | LIST_HEAD(garbage); | 113 | LIST_HEAD(garbage); |
112 | 114 | ||
@@ -121,6 +123,7 @@ static void __kcore_update_ram(struct list_head *list) | |||
121 | } else | 123 | } else |
122 | list_splice(list, &garbage); | 124 | list_splice(list, &garbage); |
123 | kcore_need_update = 0; | 125 | kcore_need_update = 0; |
126 | proc_root_kcore->size = get_kcore_size(&nphdr, &size); | ||
124 | write_unlock(&kclist_lock); | 127 | write_unlock(&kclist_lock); |
125 | 128 | ||
126 | free_kclist_ents(&garbage); | 129 | free_kclist_ents(&garbage); |
@@ -429,7 +432,8 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) | |||
429 | unsigned long start; | 432 | unsigned long start; |
430 | 433 | ||
431 | read_lock(&kclist_lock); | 434 | read_lock(&kclist_lock); |
432 | proc_root_kcore->size = size = get_kcore_size(&nphdr, &elf_buflen); | 435 | size = get_kcore_size(&nphdr, &elf_buflen); |
436 | |||
433 | if (buflen == 0 || *fpos >= size) { | 437 | if (buflen == 0 || *fpos >= size) { |
434 | read_unlock(&kclist_lock); | 438 | read_unlock(&kclist_lock); |
435 | return 0; | 439 | return 0; |