From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756368AbbAZPOY (ORCPT ); Mon, 26 Jan 2015 10:14:24 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:46248 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756340AbbAZPOW (ORCPT ); Mon, 26 Jan 2015 10:14:22 -0500 Date: Mon, 26 Jan 2015 18:13:59 +0300 From: Dan Carpenter To: Vladimir Davydov Cc: Andrew Morton , Johannes Weiner , Michal Hocko , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -mm] slab: update_memcg_params: explicitly check that old array != NULL Message-ID: <20150126151359.GD6507@mwanda> References: <20150126085638.GA6507@mwanda> <1422266479-29098-1-git-send-email-vdavydov@parallels.com> <20150126101902.GC6507@mwanda> <20150126104534.GA28978@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150126104534.GA28978@esperanza> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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