linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: Ivo van Doorn <ivdoorn@gmail.com>
Cc: "John Linville" <linville@tuxdriver.com>, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: Prevent unregistering of unregistered hw
Date: Fri, 9 Mar 2007 16:46:05 +0100	[thread overview]
Message-ID: <200703091646.05292.mb@bu3sch.de> (raw)
In-Reply-To: <200703091614.04526.IvDoorn@gmail.com>

On Friday 09 March 2007 16:14, Ivo van Doorn wrote:
> At the moment it is possible to call ieee80211_unregister_hw()
> for an unregistered hw structure. This will cause a big panic.
> This patch will add a check to check if IEEE80211_DEV_REGISTERED
> has been set before attempting to unregister hw.

For which reason would a driver call unregister, but not register before?
I smell design problems in the driver ;)

> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
> 
> ---
> 
> diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
> index 577dbe3..7494280 100644
> --- a/net/mac80211/ieee80211.c
> +++ b/net/mac80211/ieee80211.c
> @@ -4765,6 +4765,12 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw)
>  	/* TODO: skb_queue should be empty here, no need to do anything? */
>  
>  	rtnl_lock();
> +
> +	if (local->reg_state != IEEE80211_DEV_REGISTERED) {
> +		rtnl_unlock();
> +		return;
> +	}
> +
>  	local->reg_state = IEEE80211_DEV_UNREGISTERED;
>  	if (local->apdev)
>  		ieee80211_if_del_mgmt(local);

-- 
Greetings Michael.

  reply	other threads:[~2007-03-09 15:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-09 15:14 [PATCH] mac80211: Prevent unregistering of unregistered hw Ivo van Doorn
2007-03-09 15:46 ` Michael Buesch [this message]
2007-03-09 16:30   ` Ivo van Doorn
2007-03-22 10:37     ` Johannes Berg
2007-03-22 10:49       ` Ivo Van Doorn
2007-03-23 17:36       ` Jiri Benc
2007-03-23 20:08         ` [PATCH] mac80211: BUG_ON unregistering unregistered device Johannes Berg

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=200703091646.05292.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=ivdoorn@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    /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).