From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx> Handle BT_CLOSED state change by removing AMP manager. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx> --- net/bluetooth/a2mp.c | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c index d505c77..190827f 100644 --- a/net/bluetooth/a2mp.c +++ b/net/bluetooth/a2mp.c @@ -110,8 +110,20 @@ static void state_change_worker(struct work_struct *w) { struct a2mp_work_state_change *work = (struct a2mp_work_state_change *) w; struct sock *sk = work->sk; + struct amp_mgr *mgr; + + BT_DBG("sk %p state %d", sk, sk->sk_state); + + switch(sk->sk_state) { + case BT_CLOSED: + mgr = get_amp_mgr_sk(sk); + if (mgr) { + BT_DBG("sk %p closing", sk); + remove_amp_mgr(mgr); + } + break; + } - BT_DBG("sk %p", sk); sock_put(work->sk); kfree(work); } -- 1.7.4.1 -- 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