Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

rfkill: Fix device type check when toggling states

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>

authored by

Carlos Corbacho and committed by
John W. Linville
89796f64 cdbbe3d1

+1 -1
+1 -1
net/rfkill/rfkill.c
··· 92 92 rfkill_states[type] = state; 93 93 94 94 list_for_each_entry(rfkill, &rfkill_list, node) { 95 - if (!rfkill->user_claim) 95 + if ((!rfkill->user_claim) && (rfkill->type == type)) 96 96 rfkill_toggle_radio(rfkill, state); 97 97 } 98 98