]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Bluetooth: hci_sync: unlock on error in hci_inquiry_result_with_rssi_evt()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 11 Jan 2022 07:23:19 +0000 (10:23 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 11 Jan 2022 21:56:46 +0000 (13:56 -0800)
Add unlocks to two error paths in hci_inquiry_result_with_rssi_evt().

Fixes: c11032d73493 ("Bluetooth: hci_event: Use skb_pull_data when processing inquiry results")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_event.c

index fc30f4c03d292610614367370bca8856d332f610..05997dff566628d42b8827051d54ded938c4c6c2 100644 (file)
@@ -4534,7 +4534,7 @@ static void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, void *edata,
                        if (!info) {
                                bt_dev_err(hdev, "Malformed HCI Event: 0x%2.2x",
                                           HCI_EV_INQUIRY_RESULT_WITH_RSSI);
-                               return;
+                               goto unlock;
                        }
 
                        bacpy(&data.bdaddr, &info->bdaddr);
@@ -4565,7 +4565,7 @@ static void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, void *edata,
                        if (!info) {
                                bt_dev_err(hdev, "Malformed HCI Event: 0x%2.2x",
                                           HCI_EV_INQUIRY_RESULT_WITH_RSSI);
-                               return;
+                               goto unlock;
                        }
 
                        bacpy(&data.bdaddr, &info->bdaddr);
@@ -4587,7 +4587,7 @@ static void hci_inquiry_result_with_rssi_evt(struct hci_dev *hdev, void *edata,
                bt_dev_err(hdev, "Malformed HCI Event: 0x%2.2x",
                           HCI_EV_INQUIRY_RESULT_WITH_RSSI);
        }
-
+unlock:
        hci_dev_unlock(hdev);
 }