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 <cheng.chang@nxp.com>
This commit is contained in:
Cheng Chang 2025-07-23 09:50:25 +08:00 committed by Chris Friedt
parent 8f37d3bf52
commit f4153476cd

View File

@ -419,7 +419,7 @@ static int bt_a2dp_set_config_cb(struct bt_avdtp_req *req, struct net_buf *buf)
}
ops = stream->ops;
if ((!req->status) && (ops->configured != NULL)) {
if ((!req->status) && (ops != NULL) && (ops->configured != NULL)) {
ops->configured(stream);
}
return 0;