Skip to content

Commit

Permalink
Bluetooth: hci_sync: unlock on error in hci_inquiry_result_with_rssi_…
Browse files Browse the repository at this point in the history
…evt()

Add unlocks to two error paths in hci_inquiry_result_with_rssi_evt().

Fixes: fee6450 ("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>
  • Loading branch information
Dan Carpenter authored and Luiz Augusto von Dentz committed Jan 11, 2022
1 parent 386f626 commit c07ba87
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/bluetooth/hci_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand All @@ -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);
}

Expand Down

0 comments on commit c07ba87

Please sign in to comment.