From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752526AbbCZL0X (ORCPT ); Thu, 26 Mar 2015 07:26:23 -0400 Received: from pandora.arm.linux.org.uk ([78.32.30.218]:43772 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624AbbCZL0S (ORCPT ); Thu, 26 Mar 2015 07:26:18 -0400 Date: Thu, 26 Mar 2015 11:26:04 +0000 From: Russell King - ARM Linux To: Nicholas Krause Cc: dbaryshkov@gmail.com, linux-pcmcia@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCHv2] pcmcia:Fix memory leak in the function, sa11xx_drv_pcmcia_probe Message-ID: <20150326112604.GA8656@n2100.arm.linux.org.uk> References: <1427339752-25800-1-git-send-email-xerofoify@gmail.com> <20150326095225.GY8656@n2100.arm.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 26, 2015 at 07:14:38AM -0400, Nicholas Krause wrote: > > > On March 26, 2015 5:52:25 AM EDT, Russell King - ARM Linux wrote: > >On Wed, Mar 25, 2015 at 11:15:52PM -0400, Nicholas Krause wrote: > >> This fixes the memory found when running coccinelle on the latest > > > >How does this "fix the memory" ? Is the memory faulty? > > > >> kernel tree for if we are unable to successfully allocate memory > >> for the structure pointer,sinfo of type skt_dev_info and need to > >> clean up the memory already allocated to the clk structure pointer, > >> clk by calling clk_get on it and freeing the no longer required > >> mermory for this structure pointer. > > > >This makes no sense. clk_get() itself doesn't allocate any memory. As > >usual, you act as a mechanical automatom which doesn't understand what > >you're doing or you just guess. I don't care which it is, you are a > >danger to the kernel by doing this. As many other experienced kernel > >developers have told you, please stop. > > > >In any case, I'm NAKing your patch as there's better ways to solve > >this. > >That's where experience and research come in. > > > >Nevertheless, thanks for pointing out the oversight, and I notice that > >there are a few more cases too. > Very well then I guess my patch commit message was wrong. Again, you fail to understand what you are being told. Please re-read the paragraph which starts "In any case, I'm NAKing your patch". Your patch is one way to solve it, but there are other solutions too. I've just posted a small patch series which addresses the issue you have raised. You need to perform no further action on this. -- FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up according to speedtest.net.