[PATCH BlueZ] audio: Fix attempting to create a device on driver .remove

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

 



From: Luiz Augusto von Dentz <luiz.von.dentz@xxxxxxxxx>

audio_remove calls get_audio_dev which may attempt to create the device
if it doesn't exist.
---
 audio/manager.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/audio/manager.c b/audio/manager.c
index fbfe00f..6d7ac55 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -668,9 +668,12 @@ static struct audio_device *get_audio_dev(struct btd_device *device)
 static void audio_remove(struct btd_device *device)
 {
 	struct audio_device *dev;
+	const char *path;
 
-	dev = get_audio_dev(device);
-	if (!dev)
+	path = device_get_path(device);
+
+	dev = manager_find_device(path, NULL, NULL, NULL, FALSE);
+	if (dev == NULL)
 		return;
 
 	devices = g_slist_remove(devices, dev);
-- 
1.7.11.4

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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