linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Vladimir Davydov <vdavydov@parallels.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@suse.cz>, Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -mm] slab: update_memcg_params: explicitly check that old array != NULL
Date: Mon, 26 Jan 2015 18:13:59 +0300	[thread overview]
Message-ID: <20150126151359.GD6507@mwanda> (raw)
In-Reply-To: <20150126104534.GA28978@esperanza>

On Mon, Jan 26, 2015 at 01:45:34PM +0300, Vladimir Davydov wrote:
> On Mon, Jan 26, 2015 at 01:23:05PM +0300, Dan Carpenter wrote:
> > On Mon, Jan 26, 2015 at 01:01:19PM +0300, Vladimir Davydov wrote:
> > > This warning is false-positive, because @old equals NULL iff
> > > @memcg_nr_cache_ids equals 0.
> > 
> > I don't see how it could be a false positive.  The "old" pointer is
> > dereferenced inside the call to memset() so unless memset is a macro the
> > compiler isn't going to optimize the dereference away.
> 
> old->entries is not dereferenced: memcg_cache_array->entries is not a
> pointer - it is embedded to the memcg_cache_array struct.

Ah.  Ok.  Thanks.

regards,
dan carpenter

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2015-01-26 15:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-26  8:56 [mmotm:master 200/417] mm/slab_common.c:166 update_memcg_params() warn: variable dereferenced before check 'old' (see line 162) Dan Carpenter
2015-01-26 10:01 ` [PATCH -mm] slab: update_memcg_params: explicitly check that old array != NULL Vladimir Davydov
2015-01-26 10:23   ` Dan Carpenter
2015-01-26 10:45     ` Vladimir Davydov
2015-01-26 15:13       ` Dan Carpenter [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=20150126151359.GD6507@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=hannes@cmpxchg.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.com \
    --cc=vdavydov@parallels.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).