From patchwork Mon Jul 13 21:25:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Slaby X-Patchwork-Id: 35478 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n6DLXErg005442 for ; Mon, 13 Jul 2009 21:33:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757495AbZGMVdJ (ORCPT ); Mon, 13 Jul 2009 17:33:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757362AbZGMVdI (ORCPT ); Mon, 13 Jul 2009 17:33:08 -0400 Received: from server1.wserver.cz ([82.113.45.157]:52902 "EHLO server1.wserver.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757365AbZGMVdH (ORCPT ); Mon, 13 Jul 2009 17:33:07 -0400 Received: from localhost.localdomain (unknown [82.113.46.245]) by server1.wserver.cz (Postfix) with ESMTP id D7672C4791; Mon, 13 Jul 2009 23:31:00 +0200 (CEST) From: Jiri Slaby To: akpm@linux-foundation.org Cc: linux-acpi@vger.kernel.org, lenb@kernel.org, linux-kernel@vger.kernel.org, Jiri Slaby Subject: [PATCH] toshiba_acpi: return on a fail path Date: Mon, 13 Jul 2009 23:25:03 +0200 Message-Id: <1247520303-32070-1-git-send-email-jirislaby@gmail.com> X-Mailer: git-send-email 1.6.3.2 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org 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 --- drivers/platform/x86/toshiba_acpi.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 81d31ea..51c0a8b 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c @@ -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;