Skip to content

Commit f415347

Browse files
CC0918cfriedt
authored andcommitted
bluetooth: host: a2dp: Fix null ops before calling configured callback
If stream->ops is NULL and not checked, it works fail. Signed-off-by: Cheng Chang <[email protected]>
1 parent 8f37d3b commit f415347

File tree

1 file changed

+1
-1
lines changed
  • subsys/bluetooth/host/classic

1 file changed

+1
-1
lines changed

subsys/bluetooth/host/classic/a2dp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ static int bt_a2dp_set_config_cb(struct bt_avdtp_req *req, struct net_buf *buf)
419419
}
420420

421421
ops = stream->ops;
422-
if ((!req->status) && (ops->configured != NULL)) {
422+
if ((!req->status) && (ops != NULL) && (ops->configured != NULL)) {
423423
ops->configured(stream);
424424
}
425425
return 0;

0 commit comments

Comments
 (0)