Make find_remote_sep() safe for passing NULL pointers. Found with the SVACE static analysis tool. --- profiles/audio/a2dp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c index a3c294bc3..43da38051 100644 --- a/profiles/audio/a2dp.c +++ b/profiles/audio/a2dp.c @@ -1327,6 +1327,9 @@ static struct a2dp_remote_sep *find_remote_sep(struct a2dp_channel *chan, { struct avdtp_remote_sep *rsep; + if (!chan || !sep) + return NULL; + rsep = avdtp_find_remote_sep(chan->session, sep->lsep); return queue_find(chan->seps, match_remote_sep, rsep); -- 2.34.1