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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 --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);
 }
-- 
2.43.0





[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux