All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] bass: add NULL check to bass_handle_add_src_op()
@ 2024-06-27  8:56 Roman Smirnov
  2024-06-27 10:43 ` [BlueZ] " bluez.test.bot
  2024-06-27 18:32 ` [PATCH BlueZ] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 3+ messages in thread
From: Roman Smirnov @ 2024-06-27  8:56 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Roman Smirnov

This prevents a null pointer from being dereferenced in case
queue_find() returns NULL.
---
 src/shared/bass.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/shared/bass.c b/src/shared/bass.c
index c30537dee..f08799714 100644
--- a/src/shared/bass.c
+++ b/src/shared/bass.c
@@ -875,7 +875,8 @@ static void bass_handle_add_src_op(struct bt_bass *bass,
 					attr);
 
 		queue_remove(bass->ldb->bcast_srcs, src);
-		bass_bcast_src_free(src);
+		if (src)
+			bass_bcast_src_free(src);
 		bcast_src->attr = attr;
 	}
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-27 18:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-27  8:56 [PATCH BlueZ] bass: add NULL check to bass_handle_add_src_op() Roman Smirnov
2024-06-27 10:43 ` [BlueZ] " bluez.test.bot
2024-06-27 18:32 ` [PATCH BlueZ] " Luiz Augusto von Dentz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.