kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Américo Wang" <xiyou.wangcong@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Dan Carpenter <error27@gmail.com>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>,
	Jiri Slaby <jirislaby@gmail.com>,
	Jaswinder Singh Rajput <jaswinderrajput@gmail.com>,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] kcore: fix test for end of list
Date: Tue, 23 Mar 2010 07:00:58 +0000	[thread overview]
Message-ID: <2375c9f91003230000m171f35c0t66fc3a5094b0d881@mail.gmail.com> (raw)
In-Reply-To: <20100322233113.f17d0e0c.akpm@linux-foundation.org>

On Tue, Mar 23, 2010 at 11:31 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Mon, 22 Mar 2010 15:05:09 +0300 Dan Carpenter <error27@gmail.com> wrote:
>
>> "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)) {
>
> hm, that code's been there for five years.  I wonder if it's actually necessary.

Nope, not that long, please see commit 2ef43ec7. :)

      parent reply	other threads:[~2010-03-23  7:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

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=2375c9f91003230000m171f35c0t66fc3a5094b0d881@mail.gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=error27@gmail.com \
    --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 \
    /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).