diff options
author | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-01-28 17:44:32 +0200 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2013-01-30 10:27:34 +0200 |
commit | 23f142c6534138fa9f5911c7d1069864c5ea6b19 (patch) | |
tree | acb7fba028ebda9fce643ae37543394791f69d3c /src/technology.c | |
parent | 77e67badd41d01cfc7631312fab57a01dc135456 (diff) | |
download | connman-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.c | 6 |
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; } } |