diff mbox series

Bluetooth: Fix inconsistent returns 'hdev->lock'

Message ID 20200127191133.5144-1-luiz.dentz@gmail.com
State New
Headers show
Series Bluetooth: Fix inconsistent returns 'hdev->lock' | expand

Commit Message

Luiz Augusto von Dentz Jan. 27, 2020, 7:11 p.m. UTC
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

If Set CIG Parameters fails the hdev->lock was left locked.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
---
 net/bluetooth/hci_event.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index c40ae10e7b9a..bea39d5f6936 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -3168,7 +3168,7 @@  static void hci_cc_le_set_cig_params(struct hci_dev *hdev, struct sk_buff *skb)
 			conn->state = BT_CLOSED;
 			hci_connect_cfm(conn, rp->status);
 			hci_conn_del(conn);
-			return;
+			goto unlock;
 		}
 
 		conn->handle = __le16_to_cpu(rp->handle[i++]);
@@ -3183,6 +3183,7 @@  static void hci_cc_le_set_cig_params(struct hci_dev *hdev, struct sk_buff *skb)
 			break;
 	}
 
+unlock:
 	rcu_read_unlock();
 
 	hci_dev_unlock(hdev);