public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ v1] bass: add NULL check to bass_bcast_src_free()
@ 2024-06-28  7:35 Roman Smirnov
  2024-06-28  9:44 ` [BlueZ,v1] " bluez.test.bot
  2024-06-28 15:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth
  0 siblings, 2 replies; 3+ messages in thread
From: Roman Smirnov @ 2024-06-28  7:35 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Roman Smirnov

Make bass_bcast_src_free() safe for passing NULL pointers.
---
 src/shared/bass.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/shared/bass.c b/src/shared/bass.c
index c30537dee..d82c043ac 100644
--- a/src/shared/bass.c
+++ b/src/shared/bass.c
@@ -1272,6 +1272,9 @@ static void bass_bcast_src_free(void *data)
 {
 	struct bt_bcast_src *bcast_src = data;
 
+	if (!bcast_src)
+		return;
+
 	for (int i = 0; i < bcast_src->num_subgroups; i++)
 		free(bcast_src->subgroup_data[i].meta);
 
-- 
2.43.0


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

end of thread, other threads:[~2024-06-28 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-28  7:35 [PATCH BlueZ v1] bass: add NULL check to bass_bcast_src_free() Roman Smirnov
2024-06-28  9:44 ` [BlueZ,v1] " bluez.test.bot
2024-06-28 15:10 ` [PATCH BlueZ v1] " patchwork-bot+bluetooth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox