diff mbox series

[BlueZ,v1] avdtp: add NULL check to avdtp_has_stream()

Message ID 20240628150418.563987-1-r.smirnov@omp.ru (mailing list archive)
State New, archived
Headers show
Series [BlueZ,v1] avdtp: add NULL check to avdtp_has_stream() | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/BuildEll success Build ELL PASS
tedd_an/BluezMake success Bluez Make PASS
tedd_an/MakeCheck success Bluez Make Check PASS
tedd_an/MakeDistcheck success Make Distcheck PASS
tedd_an/CheckValgrind success Check Valgrind PASS
tedd_an/CheckSmatch success CheckSparse PASS
tedd_an/bluezmakeextell success Make External ELL PASS
tedd_an/IncrementalBuild success Incremental Build PASS
tedd_an/ScanBuild success Scan Build PASS

Commit Message

Roman Smirnov June 28, 2024, 3:04 p.m. UTC
Make avdtp_has_stream() safe for passing NULL pointers.

Found with the SVACE static analysis tool.
---
 profiles/audio/avdtp.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

bluez.test.bot@gmail.com June 28, 2024, 4:38 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=866642

---Test result---

Test Summary:
CheckPatch                    PASS      0.44 seconds
GitLint                       PASS      0.31 seconds
BuildEll                      PASS      24.73 seconds
BluezMake                     PASS      1644.91 seconds
MakeCheck                     PASS      13.35 seconds
MakeDistcheck                 PASS      175.44 seconds
CheckValgrind                 PASS      250.49 seconds
CheckSmatch                   PASS      350.87 seconds
bluezmakeextell               PASS      118.51 seconds
IncrementalBuild              PASS      1415.10 seconds
ScanBuild                     PASS      979.88 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 3667e0840..913298319 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
@@ -3918,6 +3918,9 @@  struct btd_device *avdtp_get_device(struct avdtp *session)
 
 gboolean avdtp_has_stream(struct avdtp *session, struct avdtp_stream *stream)
 {
+	if (!session)
+		return FALSE;
+
 	return g_slist_find(session->streams, stream) ? TRUE : FALSE;
 }