summaryrefslogtreecommitdiff
path: root/src/technology.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-01-28 17:44:32 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-01-30 10:27:34 +0200
commit23f142c6534138fa9f5911c7d1069864c5ea6b19 (patch)
treeacb7fba028ebda9fce643ae37543394791f69d3c /src/technology.c
parent77e67badd41d01cfc7631312fab57a01dc135456 (diff)
downloadconnman-23f142c6534138fa9f5911c7d1069864c5ea6b19.tar.gz
connman-23f142c6534138fa9f5911c7d1069864c5ea6b19.tar.bz2
connman-23f142c6534138fa9f5911c7d1069864c5ea6b19.zip
technology: Remove technology driver by pointer
Compare the technology driver pointer to the driver being unregistered as the function is supposed to remove only the given driver. Also check if the driver has a remove function before calling it.
Diffstat (limited to 'src/technology.c')
-rw-r--r--src/technology.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/technology.c b/src/technology.c
index 6f03c69d..7f2303c4 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -162,9 +162,11 @@ void connman_technology_driver_unregister(struct connman_technology_driver *driv
if (technology->driver == NULL)
continue;
- if (technology->type == driver->type) {
- technology->driver->remove(technology);
+ if (technology->driver == driver) {
+ if (driver->remove != NULL)
+ driver->remove(technology);
technology->driver = NULL;
+ break;
}
}