diff mbox series

[BlueZ,07/14] transport: Unset transport owner before owner free

Message ID 20241024110223.77254-8-iulia.tanasescu@nxp.com (mailing list archive)
State Superseded
Headers show
Series bap: Add support for Broadcast Sink AC 13 | 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/IncrementalBuild success Incremental Build PASS

Commit Message

Iulia Tanasescu Oct. 24, 2024, 11:02 a.m. UTC
This sets the transport owner back to NULL, before the owner object
is freed.
---
 profiles/audio/transport.c | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index d71013077..dafd1c471 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
@@ -287,10 +287,15 @@  static void media_owner_remove(struct media_owner *owner)
 
 static void media_owner_free(struct media_owner *owner)
 {
+	struct media_transport *transport = owner->transport;
+
 	DBG("Owner %s", owner->name);
 
 	media_owner_remove(owner);
 
+	if (transport)
+		transport->owner = NULL;
+
 	g_free(owner->name);
 	g_free(owner);
 }