From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Miller Subject: Re: [PATCH] drivers/net/wimax/i2400m/fw.c fix possible double free Date: Sat, 20 Mar 2010 14:24:13 -0700 (PDT) Message-ID: <20100320.142413.15249200.davem@davemloft.net> References: <1268902008.10536.41.camel@ICE-BOX> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: cindy.h.kao@intel.com, wimax@linuxwimax.org, netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, linux-wimax@intel.com To: darrenrjenkins@gmail.com Return-path: In-Reply-To: <1268902008.10536.41.camel@ICE-BOX> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: wimax-bounces@linuxwimax.org Errors-To: wimax-bounces@linuxwimax.org List-Id: netdev.vger.kernel.org From: Darren Jenkins Date: Thu, 18 Mar 2010 19:46:48 +1100 > > On Thu, Mar 18, 2010 at 9:10 AM, Inaky Perez-Gonzalez > wrote: > >> If krealloc() fails to aallocate a new pointer, the old block is >> unmodified, so by doing this you are leaking a buffer allocation. > > It seems you are right. > So now understanding correctly how krealloc() works I can see that the > double kfree() can only actually happen if the el_size parameter to > i2400m_zrealloc_2x() is zero, and it isn't at the two call sites. > > So this was a false positive and I am sorry for the noise. No problem, at least the code got audited :-)