Skip to content

Commit c9708ff

Browse files
lylezhu2012aescolar
authored andcommitted
Bluetooth: A2DP: Check the pointer before using
Check the pointer `sep` before using it. Fixes #74734. Signed-off-by: Lyle Zhu <[email protected]>
1 parent 8276d4f commit c9708ff

File tree

1 file changed

+3
-4
lines changed
  • subsys/bluetooth/host/classic

1 file changed

+3
-4
lines changed

subsys/bluetooth/host/classic/a2dp.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,10 @@ static int a2dp_set_config_ind(struct bt_avdtp *session, struct bt_avdtp_sep *se
195195
int err;
196196

197197
*errcode = 0;
198+
199+
__ASSERT(sep, "Invalid sep");
200+
198201
ep = CONTAINER_OF(sep, struct bt_a2dp_ep, sep);
199-
if (ep == NULL) {
200-
*errcode = BT_AVDTP_BAD_ACP_SEID;
201-
return -1;
202-
}
203202

204203
/* parse the configuration */
205204
codec_info_element_len = 4U;

0 commit comments

Comments
 (0)