lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 14 Oct 2020 11:17:46 +0530
From:   Amitesh Chandra <amitesh.chandra@...il.com>
To:     marcel@...tmann.org, johan.hedberg@...il.com,
        linux-bluetooth@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     amitesh.chandra@...adcom.com, ravi.nagarajan@...adcom.com,
        cheneyni@...gle.com, Manoj Babulal <manoj.babulal@...adcom.com>
Subject: [PATCH 3/3] Bluetooth: hci_bcm: Ignore deprecated command fail case

From: Manoj Babulal <manoj.babulal@...adcom.com>

Broadcom VSC uart_clock_setting is deprecated in
newer controllers. Ignore error if the controller
returns invalid or bad request error code.

Signed-off-by: Amitesh Chandra <amitesh.chandra@...adcom.com>
Signed-off-by: Manoj Babulal <manoj.babulal@...adcom.com>
---
 drivers/bluetooth/hci_bcm.c | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c
index 680478f..d316788 100644
--- a/drivers/bluetooth/hci_bcm.c
+++ b/drivers/bluetooth/hci_bcm.c
@@ -158,15 +158,18 @@ static int bcm_set_baudrate(struct hci_uart *hu, unsigned int speed)
 		skb = __hci_cmd_sync(hdev, 0xfc45, 1, &clock, HCI_INIT_TIMEOUT);
 		if (IS_ERR(skb)) {
 			int err = PTR_ERR(skb);
-			bt_dev_err(hdev, "BCM: failed to write clock (%d)",
-				   err);
-			return err;
+			/* Ignore err if command is deprecated in controller */
+			if (err != -EBADRQC) {
+				bt_dev_err(hdev, "BCM: failed to write "
+						"clock (%d)", err);
+				return err;
+			}
+		} else {
+			kfree_skb(skb);
 		}
-
-		kfree_skb(skb);
 	}
 
-	bt_dev_dbg(hdev, "Set Controller UART speed to %d bit/s", speed);
+	bt_dev_info(hdev, "Set Controller UART speed to %d bit/s", speed);
 
 	param.zero = cpu_to_le16(0);
 	param.baud_rate = cpu_to_le32(speed);
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ