Kernel API rfkill_set_hw_state_reason() wrongly gets previous block state by using its parameter @reason as reason mask. Fixed by using @reason_mask as reason mask. Fixes: 14486c82612a ("rfkill: add a reason to the HW rfkill state") Signed-off-by: Zijun Hu <quic_zijuhu@xxxxxxxxxxx> --- net/rfkill/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/rfkill/core.c b/net/rfkill/core.c index 0dc982b4fce6..ee7a751b6c5a 100644 --- a/net/rfkill/core.c +++ b/net/rfkill/core.c @@ -554,7 +554,7 @@ bool rfkill_set_hw_state_reason(struct rfkill *rfkill, } spin_lock_irqsave(&rfkill->lock, flags); - prev = !!(rfkill->hard_block_reasons & reason); + prev = !!(rfkill->hard_block_reasons & reason_mask); if (blocked) { rfkill->state |= RFKILL_BLOCK_HW; rfkill->hard_block_reasons |= reason; -- 2.7.4