Skip to content

Commit

Permalink
rfkill: Fix device type check when toggling states
Browse files Browse the repository at this point in the history
rfkill_switch_all() is supposed to only switch all the interfaces of a
given type, but does not actually do this; instead, it just switches
everything currently in the same state.

Add the necessary type check in.

(This fixes a bug I've been seeing while developing an rfkill laptop
driver, with both bluetooth and wireless simultaneously changing state
after only pressing either KEY_WLAN or KEY_BLUETOOTH).

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Carlos Corbacho authored and John W. Linville committed Apr 15, 2008
1 parent cdbbe3d commit 89796f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/rfkill/rfkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ void rfkill_switch_all(enum rfkill_type type, enum rfkill_state state)
rfkill_states[type] = state;

list_for_each_entry(rfkill, &rfkill_list, node) {
if (!rfkill->user_claim)
if ((!rfkill->user_claim) && (rfkill->type == type))
rfkill_toggle_radio(rfkill, state);
}

Expand Down

0 comments on commit 89796f6

Please sign in to comment.