From 7dc921093967a30537737c1f2a9396a498f078e5 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Tue, 16 Feb 2016 14:04:31 +0100 Subject: [PATCH] Bluetooth: ATT: Fix notifying GATT on disconnection Channel context was cleared before calling bt_gatt_disconnected which resulted in passing NULL conn to it. Change-Id: I486d1cf6662716584c2c973366a9c9654f499802 Signed-off-by: Szymon Janc --- net/bluetooth/att.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/bluetooth/att.c b/net/bluetooth/att.c index 059c3ba555b..436fdd214cd 100644 --- a/net/bluetooth/att.c +++ b/net/bluetooth/att.c @@ -1656,8 +1656,8 @@ static void bt_att_disconnected(struct bt_l2cap_chan *chan) BT_DBG("chan %p cid 0x%04x", chan, chan->tx.cid); - memset(att, 0, sizeof(*att)); bt_gatt_disconnected(chan->conn); + memset(att, 0, sizeof(*att)); } #if defined(CONFIG_BLUETOOTH_SMP)