Commit 9be685ee authored by Lyle Zhu's avatar Lyle Zhu Committed by Alberto Escolar
Browse files

Bluetooth: A2DP: Access pointer if it is valid

Only access if the pointer `stream` is valid.

Fixes #74735
Fixes #74740

Signed-off-by: default avatarLyle Zhu <lyle.zhu@nxp.com>
parent 19fe0673
Loading
Loading
Loading
Loading
+3 −5
Changes for subsys/bluetooth/host/classic/a2dp.c: 3 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -252,13 +252,11 @@ static int a2dp_set_config_ind(struct bt_avdtp *session, struct bt_avdtp_sep *se
			stream->remote_ep = NULL;
			stream->codec_config = *cfg.codec_config;
			ep->stream = stream;
		}
	}

			ops = stream->ops;
	if (*errcode == 0) {
		if ((ops != NULL) && (stream->ops->configured != NULL)) {
			stream->ops->configured(stream);
			if ((ops != NULL) && (ops->configured != NULL)) {
				ops->configured(stream);
			}
		}
	}