Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964775AbVJMUaU (ORCPT ); Thu, 13 Oct 2005 16:30:20 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S964777AbVJMUaT (ORCPT ); Thu, 13 Oct 2005 16:30:19 -0400 Received: from mail.metronet.co.uk ([213.162.97.75]:41856 "EHLO mail.metronet.co.uk") by vger.kernel.org with ESMTP id S964775AbVJMUaS (ORCPT ); Thu, 13 Oct 2005 16:30:18 -0400 From: Alistair John Strachan To: "Miller, Mike (OS Dev)" Subject: Re: [PATCH 09/14] Big kfree NULL check cleanup - misc remaining drivers Date: Thu, 13 Oct 2005 21:30:18 +0100 User-Agent: KMail/1.8.91 Cc: "Jesper Juhl" , "linux-kernel" , "Andrew Morton" , "Len Brown" , "ISS StorageDev" , "Jakub Jelinek" , "Frodo Looijaard" , "Jean Delvare" , "Bartlomiej Zolnierkiewicz" , "Jens Axboe" , "Roland Dreier" , "Sergio Rozanski Filho" , "Benjamin Herrenschmidt" , "Pierre Ossman" , "Carsten Gross" , "Greg Kroah-Hartman" , "David Hinds" , "Vinh Truong" , "Mark Douglas Corner" , "Michael Downey" , "Antonino Daplas" , "Ben Gardner" References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510132130.18686.s0348365@sms.ed.ac.uk> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1354 Lines: 40 On Thursday 13 October 2005 21:01, you wrote: > > From: Jesper Juhl [mailto:jesper.juhl@gmail.com] > > This is the remaining misc drivers/ part of the big kfree > > cleanup patch. > > > > Remove pointless checks for NULL prior to calling kfree() in > > misc files in drivers/. > > > > > > --- linux-2.6.14-rc4-orig/drivers/block/cciss.c > > 2005-10-11 22:41:05.000000000 +0200 > > +++ linux-2.6.14-rc4/drivers/block/cciss.c 2005-10-12 > > 17:43:18.000000000 +0200 > > @@ -1096,14 +1096,11 @@ static int cciss_ioctl(struct inode *ino > > cleanup1: > > if (buff) { > > for(i=0; i > - if(buff[i] != NULL) > > - kfree(buff[i]); > > I'm not sure I agree that these are pointless checks. They're not in the > main code path so nothing is lost by checking first. What if the pointer > is NULL???? > kfree() handles a NULL argument gracefully. Jesper's making these cleanups to eliminate the redundant checking. -- Cheers, Alistair. 'No sense being pessimistic, it probably wouldn't work anyway.' Third year Computer Science undergraduate. 1F2 55 South Clerk Street, Edinburgh, UK. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/