toshiba_acpi: return on a fail path
authorJiri Slaby <[email protected]>
Thu, 6 Aug 2009 22:57:51 +0000 (15:57 -0700)
committerLen Brown <[email protected]>
Fri, 28 Aug 2009 19:17:07 +0000 (15:17 -0400)
Return from bt_rfkill_poll() when hci_get_radio_state() fails.

value is invalid in that case and should not be assigned to the rfkill
state.

This also fixes a double unlock bug.

Signed-off-by: Jiri Slaby <[email protected]>
Cc: John W. Linville <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Henrique de Moraes Holschuh <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Len Brown <[email protected]>
drivers/platform/x86/toshiba_acpi.c

index 81d31ea507d116e3186384d7a0a394d00dc0e3ae..51c0a8bee4144ff800ff200e463315590e2d729a 100644 (file)
@@ -335,6 +335,7 @@ static void bt_rfkill_poll(struct rfkill *rfkill, void *data)
        if (hci_result != HCI_SUCCESS) {
                /* Can't do anything useful */
                mutex_unlock(&dev->mutex);
+               return;
        }
 
        new_rfk_state = value;