From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx> When we delete L2CAP channel (e.g. when closing socket) we shall also delete corresponding A2MP channel. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx> --- net/bluetooth/l2cap_core.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 45c7c82..b6d901f 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c @@ -589,6 +589,7 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err) BT_DBG("chan %p, conn %p, err %d", chan, conn, err); if (conn) { + struct amp_mgr *mgr = conn->hcon->amp_mgr; /* Delete from channel list */ list_del(&chan->list); @@ -596,6 +597,14 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err) chan->conn = NULL; hci_conn_put(conn->hcon); + + /* BREDR chan corresponding to A2MP chan */ + if (mgr && chan == mgr->bredr_chan) { + BT_DBG("Remove amp_mgr %p", mgr); + l2cap_chan_close(mgr->a2mp_chan, 0); + amp_mgr_put(mgr); + conn->hcon->amp_mgr = NULL; + } } if (chan->ops->teardown) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html