summaryrefslogtreecommitdiffstats
path: root/wifi
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2009-07-28 11:03:31 -0700
committerDmitry Shmidt <dimitrysh@google.com>2009-07-28 11:03:31 -0700
commit7b43699180e593b19092eb2a091c4bca105aca77 (patch)
treeab7347dba24ae0e73a63b00fc263991a7584e061 /wifi
parentb862e1c7efa3bfdf0d305e8af744ae4f0022e568 (diff)
downloadhardware_libhardware_legacy-7b43699180e593b19092eb2a091c4bca105aca77.zip
hardware_libhardware_legacy-7b43699180e593b19092eb2a091c4bca105aca77.tar.gz
hardware_libhardware_legacy-7b43699180e593b19092eb2a091c4bca105aca77.tar.bz2
Fix possible race condition in wlan driver loading
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'wifi')
-rw-r--r--wifi/wifi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/wifi/wifi.c b/wifi/wifi.c
index ae82efe..8719cac 100644
--- a/wifi/wifi.c
+++ b/wifi/wifi.c
@@ -188,12 +188,15 @@ int wifi_load_driver()
if (property_get(DRIVER_PROP_NAME, driver_status, NULL)) {
if (strcmp(driver_status, "ok") == 0)
return 0;
- else if (strcmp(DRIVER_PROP_NAME, "failed") == 0)
+ else if (strcmp(DRIVER_PROP_NAME, "failed") == 0) {
+ wifi_unload_driver();
return -1;
+ }
}
usleep(200000);
}
property_set(DRIVER_PROP_NAME, "timeout");
+ wifi_unload_driver();
return -1;
}