summaryrefslogtreecommitdiff
path: root/src/adapter.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2009-10-20 23:09:05 +0300
committerJohan Hedberg <johan.hedberg@nokia.com>2009-10-20 23:09:05 +0300
commitd22ff9b28c86923e1f0e1b5124d1ef2a95bbb7dc (patch)
tree57d33e925cee8d824dfbb4ba4fa6858b131043d1 /src/adapter.c
parent219256e53d4001a7e61ae68302677d7763abef0c (diff)
downloadbluez-d22ff9b28c86923e1f0e1b5124d1ef2a95bbb7dc.tar.gz
Fix unloading of drivers for uninitialized adapters
If adapter initialization fails we shouldn't call the adapter driver remove callbacks since their respective probe callbacks were never called.
Diffstat (limited to 'src/adapter.c')
-rw-r--r--src/adapter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/adapter.c b/src/adapter.c
index 6a7ad9812..fec14dc16 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -2431,7 +2431,8 @@ void adapter_remove(struct btd_adapter *adapter)
device_remove(l->data, FALSE);
g_slist_free(adapter->devices);
- unload_drivers(adapter);
+ if (adapter->initialized)
+ unload_drivers(adapter);
/* Return adapter to down state if it was not up on init */
if (adapter->up && !adapter->already_up)