diff mbox series

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

Message ID 20240114224104.37716-2-silviu.barbulescu@nxp.com
State New
Headers show
Series Add code to support dynamically generated BASE | expand

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;