From: Andrew Morton <akpm@linux-foundation.org>
To: Dan Carpenter <error27@gmail.com>
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: Re: [patch] kcore: fix test for end of list
Date: Mon, 22 Mar 2010 23:31:13 -0400 [thread overview]
Message-ID: <20100322233113.f17d0e0c.akpm@linux-foundation.org> (raw)
In-Reply-To: <20100322120509.GC21571@bicker>
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.
next prev parent reply other threads:[~2010-03-23 6:32 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 [this message]
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=20100322233113.f17d0e0c.akpm@linux-foundation.org \
--to=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 \
--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