Bluetooth: AMP: Get amp_mgr reference in HS hci_conn
When assigning amp_mgr in hci_conn (type AMP_LINK) get also reference. In hci_conn_del those references would be put for both conn types AMP_LINK and ACL_LINK associated with amp_mgr. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Tento commit je obsažen v:

odevzdal
Gustavo Padovan

rodič
56f6098441
revize
f706adfead
@@ -751,11 +751,13 @@ static struct l2cap_chan *a2mp_chan_open(struct l2cap_conn *conn, bool locked)
|
||||
}
|
||||
|
||||
/* AMP Manager functions */
|
||||
void amp_mgr_get(struct amp_mgr *mgr)
|
||||
struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr)
|
||||
{
|
||||
BT_DBG("mgr %p orig refcnt %d", mgr, atomic_read(&mgr->kref.refcount));
|
||||
|
||||
kref_get(&mgr->kref);
|
||||
|
||||
return mgr;
|
||||
}
|
||||
|
||||
static void amp_mgr_destroy(struct kref *kref)
|
||||
|
@@ -123,7 +123,7 @@ struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr,
|
||||
hcon->attempt++;
|
||||
hcon->handle = __next_handle(mgr);
|
||||
hcon->remote_id = remote_id;
|
||||
hcon->amp_mgr = mgr;
|
||||
hcon->amp_mgr = amp_mgr_get(mgr);
|
||||
hcon->out = out;
|
||||
|
||||
return hcon;
|
||||
|
Odkázat v novém úkolu
Zablokovat Uživatele