From: Dan Carpenter Date: Tue, 23 Mar 2010 20:35:42 +0000 (-0700) Subject: kcore: fix test for end of list X-Git-Tag: v2.6.32.47~16 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6efcfa8880fb9ca080c7c50feb71dd0bf04ed108;p=karo-tx-linux.git 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 Acked-by: KAMEZAWA Hiroyuki Acked-by: WANG Cong Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Cc: Leonardo Chiquitto Signed-off-by: Greg Kroah-Hartman --- 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)) {