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 | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c index 3f69823..b197cf3 100644 --- a/net/bluetooth/a2mp.c +++ b/net/bluetooth/a2mp.c @@ -82,7 +82,21 @@ static void a2mp_data_ready(struct sock *sk, int bytes) static void a2mp_state_change(struct sock *sk) { - BT_DBG("sk %p", sk); + struct amp_mgr *mgr = NULL; + + mgr = get_amp_mgr_sk(sk); + if (!mgr) + return; + + BT_DBG("sk %p mgr %p state %d", sk, mgr, sk->sk_state); + + switch (sk->sk_state) { + case BT_CLOSED: + amp_mgr_put(mgr); + break; + } + + amp_mgr_put(mgr); } static void l2cap_fixed_channel_config(struct sock *sk) -- 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