From 0d375fd36b0f1bf577575f7a628d452e5c1b2634 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 25 Sep 2012 15:56:44 +0300 Subject: [PATCH] audio: Fix attempting to create a device on driver .remove 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 9fc19ccc6..70be01b3d 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_profile *p, 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); -- 2.47.3