diff mbox series

[v3,1/2] shared/bap: Fix dereference of null pointer

Message ID 20240114224104.37716-2-silviu.barbulescu@nxp.com (mailing list archive)
State Superseded
Commit 2a3e935f3f652f2b625af72d2c9abda64d742c28
Headers show
Series Add code to support dynamically generated BASE | 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

Silviu Florian Barbulescu Jan. 14, 2024, 10:41 p.m. UTC
shared/bap: Fix ScanBuild error: Dereference of null pointer

---
 src/shared/bap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com Jan. 15, 2024, 12:19 a.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=816773

---Test result---

Test Summary:
CheckPatch                    PASS      1.20 seconds
GitLint                       PASS      0.70 seconds
BuildEll                      PASS      24.23 seconds
BluezMake                     PASS      718.94 seconds
MakeCheck                     PASS      11.92 seconds
MakeDistcheck                 PASS      161.77 seconds
CheckValgrind                 PASS      224.61 seconds
CheckSmatch                   PASS      330.37 seconds
bluezmakeextell               PASS      107.24 seconds
IncrementalBuild              PASS      1328.07 seconds
ScanBuild                     PASS      960.58 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

diff --git a/src/shared/bap.c b/src/shared/bap.c
index 078d308dc..49eb8d057 100644
--- a/src/shared/bap.c
+++ b/src/shared/bap.c
@@ -4763,7 +4763,7 @@  struct bt_bap_stream *bt_bap_stream_new(struct bt_bap *bap,
 			return NULL;
 
 		bt_bap_foreach_pac(bap, type, match_pac, &match);
-		if (!match.lpac)
+		if ((!match.lpac) || (!lpac))
 			return NULL;
 		if (!match.rpac && (lpac->type != BT_BAP_BCAST_SOURCE))
 			return NULL;