Bluetooth: Release module reference counts
In three places a reference was taken without being returned.
Change-Id: I15b9ab7de530a77832d8b10fe756cfdf0b01760f
Signed-off-by: Peter Krystad <pkrystad@codeaurora.org>
diff --git a/net/bluetooth/amp.c b/net/bluetooth/amp.c
index af8ee26..b018a88 100644
--- a/net/bluetooth/amp.c
+++ b/net/bluetooth/amp.c
@@ -510,14 +510,14 @@
int result = -EINVAL;
BT_DBG("lcon %p", lcon);
- mgr = get_create_amp_mgr(lcon, NULL);
- if (!mgr)
- goto ap_finished;
- BT_DBG("mgr %p", mgr);
hdev = hci_dev_get(A2MP_HCI_ID(id));
if (!hdev)
goto ap_finished;
BT_DBG("hdev %p", hdev);
+ mgr = get_create_amp_mgr(lcon, NULL);
+ if (!mgr)
+ goto ap_finished;
+ BT_DBG("mgr %p", mgr);
conn = hci_conn_hash_lookup_ba(hdev, ACL_LINK,
&mgr->l2cap_conn->hcon->dst);
if (conn) {
@@ -534,6 +534,8 @@
return;
ap_finished:
+ if (hdev)
+ hci_dev_put(hdev);
l2cap_amp_physical_complete(result, id, remote_id, sk);
}