Skip to content

Commit 821e9f3

Browse files
LuoZhongYaokartben
authored andcommitted
Bluetooth: SDP: Don't clear l2cap chan on disconnect
- Remove memset on bt_l2cap_br_chan during SDP disconnect to prevent overwriting resources (e.g., rtx_work) still in use by L2CAP, which handles channel cleanup itself. - Delete unused partial_resp_queue to clean up code. Signed-off-by: ZhongYao Luo <LuoZhongYao@gmail.com>
1 parent 634b72a commit 821e9f3

File tree

1 file changed

+2
-7
lines changed
  • subsys/bluetooth/host/classic

1 file changed

+2
-7
lines changed

subsys/bluetooth/host/classic/sdp.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ LOG_MODULE_REGISTER(bt_sdp);
6363

6464
struct bt_sdp {
6565
struct bt_l2cap_br_chan chan;
66-
struct k_fifo partial_resp_queue;
6766
/* TODO: Allow more than one pending request */
6867
};
6968

@@ -165,11 +164,9 @@ static void bt_sdp_connected(struct bt_l2cap_chan *chan)
165164
struct bt_l2cap_br_chan,
166165
chan);
167166

168-
struct bt_sdp *sdp = CONTAINER_OF(ch, struct bt_sdp, chan);
167+
struct bt_sdp *sdp __unused = CONTAINER_OF(ch, struct bt_sdp, chan);
169168

170169
LOG_DBG("chan %p cid 0x%04x", ch, ch->tx.cid);
171-
172-
k_fifo_init(&sdp->partial_resp_queue);
173170
}
174171

175172
/** @brief Callback for SDP disconnection
@@ -186,11 +183,9 @@ static void bt_sdp_disconnected(struct bt_l2cap_chan *chan)
186183
struct bt_l2cap_br_chan,
187184
chan);
188185

189-
struct bt_sdp *sdp = CONTAINER_OF(ch, struct bt_sdp, chan);
186+
struct bt_sdp *sdp __unused = CONTAINER_OF(ch, struct bt_sdp, chan);
190187

191188
LOG_DBG("chan %p cid 0x%04x", ch, ch->tx.cid);
192-
193-
(void)memset(sdp, 0, sizeof(*sdp));
194189
}
195190

196191
/* @brief Creates an SDP PDU

0 commit comments

Comments
 (0)