Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932097AbWCODF3 (ORCPT ); Tue, 14 Mar 2006 22:05:29 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932591AbWCODF3 (ORCPT ); Tue, 14 Mar 2006 22:05:29 -0500 Received: from alcala.terra.com.br ([200.176.10.198]:3747 "EHLO alcala.terra.com.br") by vger.kernel.org with ESMTP id S932097AbWCODF2 (ORCPT ); Tue, 14 Mar 2006 22:05:28 -0500 X-Terra-Karma: -2% X-Terra-Hash: 113c6863b7bbc15d87507ed9c90def27 Message-ID: <44178469.3090907@terra.com.br> Date: Wed, 15 Mar 2006 00:05:13 -0300 From: Felipe W Damasio User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051004 X-Accept-Language: pt-br, en-us, en MIME-Version: 1.0 To: Eugene Teo CC: Linux Kernel , jkmaline@cc.hut.fi Subject: Re: Fix hostap_cs double kfree References: <20060315023900.GA8179@eugeneteo.net> In-Reply-To: <20060315023900.GA8179@eugeneteo.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 774 Lines: 36 Hi Eugene, Eugene Teo wrote: > failed: >- kfree(parse); >- kfree(hw_priv); >+ if (parse) >+ kfree(parse); >+ if (hw_priv) >+ kfree(hw_priv); > prism2_release((u_long)link); > return ret; > } > > I don't think those if's are needed, since the kfree code already does: void kfree(const void *objp) { if (unlikely(!objp)) return; ... } But if you really want to use it, I suggest using if (likely (!)) there to hint gcc of a possible optimization. Cheers, Felipe Damasio - 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/