Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261553AbVEAI3Y (ORCPT ); Sun, 1 May 2005 04:29:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261556AbVEAI3Y (ORCPT ); Sun, 1 May 2005 04:29:24 -0400 Received: from mx2.mail.ru ([194.67.23.122]:54598 "EHLO mx2.mail.ru") by vger.kernel.org with ESMTP id S261553AbVEAI3S (ORCPT ); Sun, 1 May 2005 04:29:18 -0400 Date: Sun, 1 May 2005 12:32:42 +0000 From: Alexey Dobriyan To: Jesper Juhl Cc: "David S. Miller" , Jouni Malinen , netdev@oss.sgi.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] resource release cleanup in net/ Message-ID: <20050501123242.GA8407@mipter.zuzino.mipt.ru> Mail-Followup-To: Jesper Juhl , "David S. Miller" , Jouni Malinen , netdev@oss.sgi.com, linux-kernel@vger.kernel.org References: <20050501025349.GA9243@mipter.zuzino.mipt.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1810 Lines: 43 On Sun, May 01, 2005 at 01:13:28AM +0200, Jesper Juhl wrote: > On Sun, 1 May 2005, Alexey Dobriyan wrote: > > > On Sat, Apr 30, 2005 at 10:36:00PM +0200, Jesper Juhl wrote: > > > Since Andrew merged the patch that makes calling crypto_free_tfm() with a > > > NULL pointer safe into 2.6.12-rc3-mm1, I made a patch to remove checks for > > > NULL before calling that function > > > drivers/net/wireless/hostap/hostap_crypt_ccmp.c | 5 - > > > drivers/net/wireless/hostap/hostap_crypt_tkip.c | 10 +- > > > drivers/net/wireless/hostap/hostap_crypt_wep.c | 5 - > > > net/ieee80211/ieee80211_crypt_ccmp.c | 5 - > > > net/ieee80211/ieee80211_crypt_tkip.c | 10 +- > > > net/ieee80211/ieee80211_crypt_wep.c | 5 - > > I think I have a better one for these. > > > > --- linux-2.6.12-rc3-mm1/drivers/net/wireless/hostap/hostap_crypt_ccmp.c 2005-05-01 01:53:50.000000000 +0000 > > +++ linux-2.6.12-rc3-mm1-hostap/drivers/net/wireless/hostap/hostap_crypt_ccmp.c 2005-05-01 02:21:10.000000000 +0000 > > @@ -121,8 +118,7 @@ fail: > > static void hostap_ccmp_deinit(void *priv) > > { > > struct hostap_ccmp_data *_priv = priv; > > - if (_priv && _priv->tfm) > > - crypto_free_tfm(_priv->tfm); > > + crypto_free_tfm(_priv->tfm); > > kfree(priv); > > module_put(THIS_MODULE); > > } > > This will Oops if _priv is NULL. That's why my patch did > > if (_priv) > crypto_free_tfm(_priv->tfm); After hostap_ccmp_init() returns successfully: 1. priv is valid pointer line 95 2. priv->tfm is valid pointer line 102 - 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/