summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-03-23 13:35:42 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2011-11-07 12:32:44 -0800
commit6efcfa8880fb9ca080c7c50feb71dd0bf04ed108 (patch)
tree54a7a0ffab4a84ff8c12f1312f361ceed34dd126
parent35b6863ce555ce59e36a2c2bf7c8a8e9a9da577b (diff)
downloadlwn-6efcfa8880fb9ca080c7c50feb71dd0bf04ed108.tar.gz
lwn-6efcfa8880fb9ca080c7c50feb71dd0bf04ed108.zip
kcore: fix test for end of list
commit 4fd2c20d964a8fb9861045f1022475c9d200d684 upstream. "m" is never NULL here. We need a different test for the end of list condition. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Acked-by: WANG Cong <xiyou.wangcong@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Leonardo Chiquitto <leonardo.lists@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--fs/proc/kcore.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index a44a7897fd4d..b442dac8f5f9 100644
--- a/fs/proc/kcore.c
+++ b/fs/proc/kcore.c
@@ -490,7 +490,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos)
}
read_unlock(&kclist_lock);
- if (m == NULL) {
+ if (&m->list == &kclist_head) {
if (clear_user(buffer, tsz))
return -EFAULT;
} else if (is_vmalloc_or_module_addr((void *)start)) {