Bluetooth: ATT: Notify if a disconnect happen while a request is pending

If the client is waiting for a response but the link is disconnected it
should be notified as the request may never be complete otherwise.

Change-Id: I1fb83b63d8effb4ef2a8f838566c1e68deae9f2c
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2016-03-14 12:35:07 +02:00 committed by Gerrit Code Review
commit b50a582ea1

View file

@ -1659,6 +1659,9 @@ static void bt_att_disconnected(struct bt_l2cap_chan *chan)
BT_DBG("chan %p cid 0x%04x", chan, chan->tx.cid); BT_DBG("chan %p cid 0x%04x", chan, chan->tx.cid);
/* Notify client if request is pending */
att_handle_rsp(att, NULL, 0, BT_ATT_ERR_UNLIKELY);
bt_gatt_disconnected(chan->conn); bt_gatt_disconnected(chan->conn);
memset(att, 0, sizeof(*att)); memset(att, 0, sizeof(*att));
} }