Skip to contentSkip to conversation

toshiba_acpi: return on a fail path

PATCH Applied [email protected] 2 participants 2 messages Aug 6, 2009 – Aug 27, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 4/9 toshiba_acpi: return on a fail path

From: Jiri Slaby <[email protected]>

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.

Cc John W. Linville <[email protected]>
Cc Johannes Berg <[email protected]>
Cc Len Brown <[email protected]>
Cc Henrique de Moraes Holschuh <[email protected]>

---

 drivers/platform/x86/toshiba_acpi.c |    1 +
 1 file changed, 1 insertion(+)
drivers/platform/x86/toshiba_acpi.c renamed from drivers/platform/x86/toshiba_acpi.c~toshiba_acpi-return-on-a-fail-path +1 -0
diff -puN drivers/platform/x86/toshiba_acpi.c~toshiba_acpi-return-on-a-fail-path drivers/platform/x86/toshiba_acpi.c
@@ -335,6 +335,7 @@ static void bt_rfkill_poll(struct rfkill
 	if (hci_result != HCI_SUCCESS) {
 		/* Can't do anything useful */
 		mutex_unlock(&dev->mutex);
+		return;
 	}
 
 	new_rfk_state = value;

_

reviewer Applied
#1 lore raw

applied

thanks,
Len Brown, Intel Open Source Technology Center

Quoted 33 lines · On Thu, 6 Aug 2009, [email protected] wrote:

From: Jiri Slaby <[email protected]>

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.

Cc John W. Linville <[email protected]>
Cc Johannes Berg <[email protected]>
Cc Len Brown <[email protected]>
Cc Henrique de Moraes Holschuh <[email protected]>

---

 drivers/platform/x86/toshiba_acpi.c |    1 +
 1 file changed, 1 insertion(+)

diff -puN drivers/platform/x86/toshiba_acpi.c~toshiba_acpi-return-on-a-fail-path drivers/platform/x86/toshiba_acpi.c

drivers/platform/x86/toshiba_acpi.c renamed from drivers/platform/x86/toshiba_acpi.c~toshiba_acpi-return-on-a-fail-path +1 -0
@@ -335,6 +335,7 @@ static void bt_rfkill_poll(struct rfkill
 	if (hci_result != HCI_SUCCESS) {
 		/* Can't do anything useful */
 		mutex_unlock(&dev->mutex);
+		return;
 	}
 
 	new_rfk_state = value;

_