[PATCH] Fix adapter reference count in input plugin

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

 



Adapter unref was called  on driver removal even if input server failed
to start on probe and reference was not incremented. This leads to
segmentation fault while removing adapter.
---
 input/manager.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/input/manager.c b/input/manager.c
index a98a080..259aef7 100644
--- a/input/manager.c
+++ b/input/manager.c
@@ -143,6 +143,9 @@ static void hid_server_remove(struct btd_adapter *adapter)
 {
 	bdaddr_t src;
 
+	if (!g_slist_find(adapters, adapter))
+		return;
+
 	adapter_get_address(adapter, &src);
 
 	server_stop(&src);
-- 
1.7.0.4
on behalf of ST-Ericsson
--
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