diff mbox

[4/9] toshiba_acpi: return on a fail path

Message ID 200908062257.n76MvpoF024228@imap1.linux-foundation.org (mailing list archive)
State Accepted
Headers show

Commit Message

Andrew Morton Aug. 6, 2009, 10:57 p.m. UTC
From: Jiri Slaby <jirislaby@gmail.com>

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 <jirislaby@gmail.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Len Brown <len.brown@intel.com>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

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

Comments

Len Brown Aug. 27, 2009, 5:58 p.m. UTC | #1
applied

thanks,
Len Brown, Intel Open Source Technology Center

On Thu, 6 Aug 2009, akpm@linux-foundation.org wrote:

> From: Jiri Slaby <jirislaby@gmail.com>
> 
> 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 <jirislaby@gmail.com>
> Cc: John W. Linville <linville@tuxdriver.com>
> Cc: Johannes Berg <johannes@sipsolutions.net>
> Cc: Len Brown <len.brown@intel.com>
> Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
> 
>  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
> --- a/drivers/platform/x86/toshiba_acpi.c~toshiba_acpi-return-on-a-fail-path
> +++ a/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;
> _
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff -puN drivers/platform/x86/toshiba_acpi.c~toshiba_acpi-return-on-a-fail-path drivers/platform/x86/toshiba_acpi.c
--- a/drivers/platform/x86/toshiba_acpi.c~toshiba_acpi-return-on-a-fail-path
+++ a/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;