diff mbox series

Bluetooth: hci_sync: unlock on error in hci_inquiry_result_with_rssi_evt()

Message ID 20220111072319.GH11243@kili (mailing list archive)
State Accepted
Commit c07ba878ca199a6089cdb323bf526adbeeb4201f
Delegated to: Luiz Von Dentz
Headers show
Series Bluetooth: hci_sync: unlock on error in hci_inquiry_result_with_rssi_evt() | expand

Checks

Context Check Description
tedd_an/checkpatch success Checkpatch PASS
tedd_an/gitlint fail Bluetooth: hci_sync: unlock on error in hci_inquiry_result_with_rssi_evt() 5: B1 Line exceeds max length (95>80): "Fixes: fee645033e2c ("Bluetooth: hci_event: Use skb_pull_data when processing inquiry results")"
tedd_an/buildkernel success Build Kernel PASS
tedd_an/incremental_build success Pass
tedd_an/testrunnersetup success Test Runner Setup PASS
tedd_an/testrunnerl2cap-tester success Total: 40, Passed: 40 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerbnep-tester success Total: 1, Passed: 1 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnermgmt-tester success Total: 493, Passed: 493 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnerrfcomm-tester success Total: 9, Passed: 9 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersco-tester success Total: 12, Passed: 12 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunnersmp-tester success Total: 8, Passed: 8 (100.0%), Failed: 0, Not Run: 0
tedd_an/testrunneruserchan-tester success Total: 4, Passed: 4 (100.0%), Failed: 0, Not Run: 0

Commit Message

Dan Carpenter Jan. 11, 2022, 7:23 a.m. UTC
Add unlocks to two error paths in hci_inquiry_result_with_rssi_evt().

Fixes: fee645033e2c ("Bluetooth: hci_event: Use skb_pull_data when processing inquiry results")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 net/bluetooth/hci_event.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Marcel Holtmann Jan. 21, 2022, 10:53 p.m. UTC | #1
Hi Dan,

> Add unlocks to two error paths in hci_inquiry_result_with_rssi_evt().
> 
> Fixes: fee645033e2c ("Bluetooth: hci_event: Use skb_pull_data when processing inquiry results")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> net/bluetooth/hci_event.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)

patch doesn’t apply cleanly, please rebase against bluetooth-next tree.

Regards

Marcel
Luiz Augusto von Dentz Jan. 21, 2022, 11:18 p.m. UTC | #2
Hi Marcel,

On Fri, Jan 21, 2022 at 2:53 PM Marcel Holtmann <marcel@holtmann.org> wrote:
>
> Hi Dan,
>
> > Add unlocks to two error paths in hci_inquiry_result_with_rssi_evt().
> >
> > Fixes: fee645033e2c ("Bluetooth: hci_event: Use skb_pull_data when processing inquiry results")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > net/bluetooth/hci_event.c | 6 +++---
> > 1 file changed, 3 insertions(+), 3 deletions(-)
>
> patch doesn’t apply cleanly, please rebase against bluetooth-next tree.
>
> Regards
>
> Marcel

Ive already applied this one:

https://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git/commit/?id=c07ba878ca199a6089cdb323bf526adbeeb4201f

Might have forgotten to reply here.
diff mbox series

Patch

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index f1082b7c0218..e6c75cb1c7fe 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -4536,7 +4536,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);
@@ -4566,7 +4566,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);
@@ -4588,7 +4588,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);
 }