netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gertjan van Wingerde <gwingerde@kpnplanet.nl>
To: Michael Wu <flamingice@sourmilk.net>, Jiri Benc <jbenc@suse.cz>,
	netdev@vger.kernel.org
Subject: Re: [PATCH] d80211: Only free WEP crypto ciphers when they have been allocated correctly.
Date: Sat, 06 Jan 2007 19:14:27 +0100	[thread overview]
Message-ID: <459FE703.4080800@kpnplanet.nl> (raw)
In-Reply-To: <200701061229.16632.flamingice@sourmilk.net>

Michael Wu wrote:
> On Saturday 06 January 2007 12:00, Gertjan van Wingerde wrote:
>   
>> The d80211 stack still tries to free the WEP crypto ciphers, even when
>> allocating them previously has failed. 
>>     
> Actually, the code might not even have tried to allocate them. The ciphers are 
> guaranteed to be allocated when the device is registered however, so we 
> should be able to free it safely on unregister.
>
> Signed-off-by: Michael Wu <flamingice@sourmilk.net>
> ---
>
>  net/d80211/ieee80211.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
> index 6e10db5..926d160 100644
> --- a/net/d80211/ieee80211.c
> +++ b/net/d80211/ieee80211.c
> @@ -4715,6 +4715,7 @@ void ieee80211_unregister_hw(struct ieee
>  	skb_queue_purge(&local->skb_queue_unreliable);
>  
>  	ieee80211_dev_free_index(local);
> +	ieee80211_wep_free(local);
>  	ieee80211_led_exit(local);
>  }
>  EXPORT_SYMBOL(ieee80211_unregister_hw);
> @@ -4724,7 +4725,6 @@ void ieee80211_free_hw(struct ieee80211_
>  	struct ieee80211_local *local = hw_to_local(hw);
>  
>  	ieee80211_if_free(local->mdev);
> -	ieee80211_wep_free(local);
>  	ieee80211_dev_free(local);
>  }
>  EXPORT_SYMBOL(ieee80211_free_hw);
OK. Your patch fixes the issue I've seen as well, and seems a bit cleaner.

Acked-by: Gertjan van Wingerde <gwingerde@kpnplanet.nl>

  reply	other threads:[~2007-01-06 18:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-06 17:00 [PATCH] d80211: Only free WEP crypto ciphers when they have been allocated correctly Gertjan van Wingerde
2007-01-06 17:29 ` Michael Wu
2007-01-06 18:14   ` Gertjan van Wingerde [this message]
2007-01-10 20:14   ` Jiri Benc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=459FE703.4080800@kpnplanet.nl \
    --to=gwingerde@kpnplanet.nl \
    --cc=flamingice@sourmilk.net \
    --cc=jbenc@suse.cz \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).