From: Dan Carpenter Date: Tue, 23 Mar 2010 20:35:42 +0000 (-0700) Subject: kcore: fix test for end of list X-Git-Tag: firefly_0821_release~9833^2~2504 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4fd2c20d964a8fb9861045f1022475c9d200d684;p=firefly-linux-kernel-4.4.55.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)) {