kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] kcore: fix test for end of list
@ 2010-03-22 12:05 Dan Carpenter
  2010-03-23  0:18 ` KAMEZAWA Hiroyuki
  2010-03-23  3:31 ` Andrew Morton
  0 siblings, 2 replies; 6+ messages in thread
From: Dan Carpenter @ 2010-03-22 12:05 UTC (permalink / raw)
  To: Andrew Morton
  Cc: KAMEZAWA Hiroyuki, WANG Cong, Jiri Slaby, Jaswinder Singh Rajput,
	linux-kernel, kernel-janitors

"m" is never NULL here.  We need a different test for the end of list
condition.

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
Found with a static checker and compile tested only.  Please review
carefully.

diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c
index a44a789..b442dac 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)) {

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-03-23  7:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-22 12:05 [patch] kcore: fix test for end of list Dan Carpenter
2010-03-23  0:18 ` KAMEZAWA Hiroyuki
2010-03-23  2:47   ` Américo Wang
2010-03-23  3:31 ` Andrew Morton
2010-03-23  6:54   ` KAMEZAWA Hiroyuki
2010-03-23  7:00   ` Américo Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).