kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	WANG Cong <xiyou.wangcong@gmail.com>,
	Jiri Slaby <jirislaby@gmail.com>,
	Jaswinder Singh Rajput <jaswinderrajput@gmail.com>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] kcore: fix test for end of list
Date: Mon, 22 Mar 2010 12:05:09 +0000	[thread overview]
Message-ID: <20100322120509.GC21571@bicker> (raw)

"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)) {

             reply	other threads:[~2010-03-22 12:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-22 12:05 Dan Carpenter [this message]
2010-03-23  0:18 ` [patch] kcore: fix test for end of list 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100322120509.GC21571@bicker \
    --to=error27@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=jaswinderrajput@gmail.com \
    --cc=jirislaby@gmail.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).