public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pekka Enberg <penberg@cs.helsinki.fi>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: "J. R. Okajima" <hooanon05@yahoo.co.jp>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] slab, kmemleak, minor, stop calling kmemleak_erase() unconditionally
Date: Sun, 06 Dec 2009 10:33:00 +0200	[thread overview]
Message-ID: <4B1B6C3C.7060503@cs.helsinki.fi> (raw)
In-Reply-To: <tnxr5rd4s6m.fsf@pc1117.cambridge.arm.com>

Catalin Marinas wrote:
> "J. R. Okajima" <hooanon05@yahoo.co.jp> wrote:
>> When the gotten object is NULL (probably due to ENOMEM),
>> kmemleak_erase() is unnecessary here, It just sets NULL to where already
>> is NULL.
>> Add a condition.
>>
>> Signed-off-by: J. R. Okajima <hooanon05@yahoo.co.jp>
>> ---
>>  mm/slab.c |    3 ++-
>>  1 files changed, 2 insertions(+), 1 deletions(-)
>>
>> diff --git a/mm/slab.c b/mm/slab.c
>> index 7dfa481..4e61449 100644
>> --- a/mm/slab.c
>> +++ b/mm/slab.c
>> @@ -3109,7 +3109,8 @@ static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
>>  	 * per-CPU caches is leaked, we need to make sure kmemleak doesn't
>>  	 * treat the array pointers as a reference to the object.
>>  	 */
>> -	kmemleak_erase(&ac->entry[ac->avail]);
>> +	if (objp)
>> +		kmemleak_erase(&ac->entry[ac->avail]);
>>  	return objp;
>>  }
> 
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>

Applied, thanks!

  reply	other threads:[~2009-12-06  8:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-02  7:55 [PATCH 0/2] fix for kmemleak_erase() (Re: Q, slab, kmemleak_erase() and redzone?) J. R. Okajima
2009-12-02  7:55 ` [PATCH 1/2] slab, kmemleak, minor, stop calling kmemleak_erase() unconditionally J. R. Okajima
2009-12-02  9:54   ` Catalin Marinas
2009-12-06  8:33     ` Pekka Enberg [this message]
2009-12-02  7:55 ` [PATCH 2/2] slab, kmemleak, bugfix, pass the correct pointer to kmemleak_erase() J. R. Okajima
2009-12-02  9:55   ` Catalin Marinas
2009-12-06  8:33     ` Pekka Enberg
2009-12-02  8:07 ` [PATCH 0/2] fix for kmemleak_erase() (Re: Q, slab, kmemleak_erase() and redzone?) Pekka Enberg

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=4B1B6C3C.7060503@cs.helsinki.fi \
    --to=penberg@cs.helsinki.fi \
    --cc=catalin.marinas@arm.com \
    --cc=hooanon05@yahoo.co.jp \
    --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