[PATCH BlueZ v1] audio/a2dp: add NULL checks to find_remote_sep()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux