From: Ivo van Doorn <ivdoorn@gmail.com>
To: Rami Rosen <ramirose@gmail.com>
Cc: linville@tuxdriver.com, linux-wireless@vger.kernel.org,
rt2400-devel@lists.sourceforge.net
Subject: Re: [PATCH] rt2x00: fix a wrong parameter for __test_and_clear_bit() in rt2x00rfkill_free().
Date: Tue, 13 Jan 2009 23:46:17 +0100 [thread overview]
Message-ID: <200901132346.18092.IvDoorn@gmail.com> (raw)
In-Reply-To: <eb3ff54b0901131400x64a4812fje2ee233c37546c1e@mail.gmail.com>
On Tuesday 13 January 2009, Rami Rosen wrote:
> When running modprobe rt73usb, and then rmmod rt73usb, and then
> iwconfig, the wlan0 device does not disappear. When repeating this
> process again, we get a kernel Oops errors and "BUG: unable to handle
> kernel paging request..." message in the kernel log.
>
> The reason for this is that there is an error in rt2x00rfkill_free(),
> which is called in the process of removing the device
> (rt2x00lib_remove_dev() in rt2x00dev.c).
> rt2x00rfkill_free() clears the RFKILL_STATE_ALLOCATED bit , which is
> bit number 1 () in rt2x00dev->flags instead of in
> rt2x00dev->rfkill_state. As a result, when checking the
> DEVICE_STATE_REGISTERED_HW bit (bit number 1 in rt2x00dev->flags) in
> rt2x00lib_remove_hw() it is **unset**, and we wrongly **don't** call
> ieee80211_unregister_hw().
>
> This patch corrects this: the parameter for __test_and_clear_bit() in
> rt2x00rfkill_free() should be &rt2x00dev->rfkill_state and not
> &rt2x00dev->flags.
>
> Signed-off-by: Rami Rosen <ramirose@gmail.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
> ---
> (wireless-testing).
>
> diff --git a/drivers/net/wireless/rt2x00/rt2x00rfkill.c
> b/drivers/net/wireless/rt2x00/rt2x00rfkill.c
> index 0b089ec..735a22d 100644
> --- a/drivers/net/wireless/rt2x00/rt2x00rfkill.c
> +++ b/drivers/net/wireless/rt2x00/rt2x00rfkill.c
> @@ -118,7 +118,7 @@ void rt2x00rfkill_allocate(struct rt2x00_dev *rt2x00dev)
>
> void rt2x00rfkill_free(struct rt2x00_dev *rt2x00dev)
> {
> - if (!__test_and_clear_bit(RFKILL_STATE_ALLOCATED, &rt2x00dev->flags))
> + if (!__test_and_clear_bit(RFKILL_STATE_ALLOCATED, &rt2x00dev->rfkill_state))
> return;
>
> input_free_polled_device(rt2x00dev->rfkill_poll_dev);
>
prev parent reply other threads:[~2009-01-13 22:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-13 22:00 [PATCH] rt2x00: fix a wrong parameter for __test_and_clear_bit() in rt2x00rfkill_free() Rami Rosen
2009-01-13 22:46 ` Ivo van Doorn [this message]
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=200901132346.18092.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=ramirose@gmail.com \
--cc=rt2400-devel@lists.sourceforge.net \
/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).