From b04f3a2b176b9be2b04c134c7513dcac8ecfcd90 Mon Sep 17 00:00:00 2001 From: Arkadiusz Lichwa Date: Wed, 21 Dec 2016 15:52:17 +0100 Subject: [PATCH] Bluetooth: SDP: Reset context on disconnection Resets SDP client session data on related L2CAP transport channel disconnection state. Leave the channel itself reset to L2CAP layer. Jira: ZEP-1112 Change-Id: I4d8a8f10908f5e599ba6506470b98508869cb21b Signed-off-by: Arkadiusz Lichwa --- subsys/bluetooth/host/sdp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/sdp.c b/subsys/bluetooth/host/sdp.c index 6296a0cbb69..7b6b500b391 100644 --- a/subsys/bluetooth/host/sdp.c +++ b/subsys/bluetooth/host/sdp.c @@ -340,7 +340,11 @@ static void sdp_client_disconnected(struct bt_l2cap_chan *chan) BT_DBG("session %p chan %p disconnected", session, chan); - ARG_UNUSED(session); + /* + * Reset session excluding L2CAP channel member. Let's the channel + * resets autonomous. + */ + memset(&session->reqs, 0, sizeof(*session) - sizeof(session->chan)); } static struct bt_l2cap_chan_ops sdp_client_chan_ops = {