Skip to content

Commit

Permalink
Bluetooth: A2DP: Check the pointer before using
Browse files Browse the repository at this point in the history
Check the pointer `sep` before using it.

Fixes #74734.

(cherry picked from commit c9708ff)

Original-Signed-off-by: Lyle Zhu <lyle.zhu@nxp.com>
GitOrigin-RevId: c9708ff
Change-Id: Iccfdc1076259d05077c96921eaf590238392cc38
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5680119
Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com>
Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com>
  • Loading branch information
lylezhu2012 authored and Chromeos LUCI committed Jul 5, 2024
1 parent eaa4c8c commit 529cab4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions subsys/bluetooth/host/classic/a2dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,10 @@ static int a2dp_set_config_ind(struct bt_avdtp *session, struct bt_avdtp_sep *se
int err;

*errcode = 0;

__ASSERT(sep, "Invalid sep");

ep = CONTAINER_OF(sep, struct bt_a2dp_ep, sep);
if (ep == NULL) {
*errcode = BT_AVDTP_BAD_ACP_SEID;
return -1;
}

/* parse the configuration */
codec_info_element_len = 4U;
Expand Down

0 comments on commit 529cab4

Please sign in to comment.