From: Pekka Enberg <penberg@cs.helsinki.fi>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] kmemleak: Check for NULL pointer returned by create_object()
Date: Fri, 9 Oct 2009 15:16:27 +0300 [thread overview]
Message-ID: <84144f020910090516gac3d598rad20ea3ced063acf@mail.gmail.com> (raw)
In-Reply-To: <20091009093034.4365.34259.stgit@pc1117.cambridge.arm.com>
On Fri, Oct 9, 2009 at 12:30 PM, Catalin Marinas
<catalin.marinas@arm.com> wrote:
> This patch adds NULL pointer checking in the early_alloc() function.
>
> Reported-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
> ---
> mm/kmemleak.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/mm/kmemleak.c b/mm/kmemleak.c
> index a617518..8bf765c 100644
> --- a/mm/kmemleak.c
> +++ b/mm/kmemleak.c
> @@ -834,11 +834,14 @@ static void early_alloc(struct early_log *log)
> rcu_read_lock();
> object = create_object((unsigned long)log->ptr, log->size,
> log->min_count, GFP_ATOMIC);
> + if (!object)
> + goto out;
> spin_lock_irqsave(&object->lock, flags);
> for (i = 0; i < log->trace_len; i++)
> object->trace[i] = log->trace[i];
> object->trace_len = log->trace_len;
> spin_unlock_irqrestore(&object->lock, flags);
> +out:
> rcu_read_unlock();
> }
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
next prev parent reply other threads:[~2009-10-09 12:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-09 9:30 [PATCH 1/2] kmemleak: Use GFP_ATOMIC for early_alloc() Catalin Marinas
2009-10-09 9:30 ` [PATCH 2/2] kmemleak: Check for NULL pointer returned by create_object() Catalin Marinas
2009-10-09 12:16 ` Pekka Enberg [this message]
2009-10-09 13:55 ` Paul E. McKenney
2009-10-09 9:37 ` [PATCH 1/2] kmemleak: Use GFP_ATOMIC for early_alloc() Catalin Marinas
2009-10-09 9:39 ` [PATCH] " Catalin Marinas
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=84144f020910090516gac3d598rad20ea3ced063acf@mail.gmail.com \
--to=penberg@cs.helsinki.fi \
--cc=catalin.marinas@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paulmck@linux.vnet.ibm.com \
--cc=torvalds@linux-foundation.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
Powered by JetHome