From: Dan Carpenter Date: Tue, 23 Mar 2010 20:35:42 +0000 (-0700) Subject: kcore: fix test for end of list X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4fd2c20d964a8fb9861045f1022475c9d200d684;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git kcore: fix test for end of list "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 --- 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)) {