[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <1240043283.5792.0.camel@johannes.local>
Date: Sat, 18 Apr 2009 10:28:02 +0200
From: Johannes Berg <johannes@...solutions.net>
To: Alan Jenkins <alan-jenkins@...fmail.co.uk>
Cc: netdev@...r.kernel.org
Subject: Re: rfkill rewrite bug
On Sat, 2009-04-18 at 09:17 +0100, Alan Jenkins wrote:
> When I looked at the code earlier, I saw no obvious replacement for
> rfkill_set_default(). So I tried disabling the wireless and rebooting
> to see what happened. It didn't like that :-).
Ok that wasn't too hard -- try this on top if you get a chance:
--- wireless-testing.orig/net/rfkill/core.c 2009-04-18 10:16:53.000000000 +0200
+++ wireless-testing/net/rfkill/core.c 2009-04-18 10:18:17.000000000 +0200
@@ -401,6 +401,9 @@ bool rfkill_set_hw_state(struct rfkill *
ret = __rfkill_set_hw_state(rfkill, blocked, &change);
+ if (!rfkill->registered)
+ return ret;
+
if (change)
schedule_work(&rfkill->uevent_work);
@@ -422,13 +425,17 @@ bool rfkill_set_sw_state(struct rfkill *
&rfkill->blocked);
hwblock = !!test_bit(RFKILL_BLOCK_HW_BIT, &rfkill->blocked);
+ blocked = blocked || hwblock;
+
+ if (!rfkill->registered)
+ return blocked;
if (prev != blocked && !hwblock)
schedule_work(&rfkill->uevent_work);
rfkill_led_trigger_event(rfkill);
- return blocked || hwblock;
+ return blocked;
}
EXPORT_SYMBOL(rfkill_set_sw_state);
@@ -452,6 +459,9 @@ void rfkill_set_states(struct rfkill *rf
hwprev = !!test_and_clear_bit(RFKILL_BLOCK_HW_BIT,
&rfkill->blocked);
+ if (!rfkill->registered)
+ return;
+
if (swprev != sw || hwprev != hw)
schedule_work(&rfkill->uevent_work);
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists