diff options
author | Hu Wang <huw@codeaurora.org> | 2016-01-07 13:26:33 +0800 |
---|---|---|
committer | Keith Mok <kmok@cyngn.com> | 2016-02-02 12:02:51 -0800 |
commit | 17d8e9f041abbf68cfdeea312110856422279566 (patch) | |
tree | 4d6f81ba171dfba84af59d05d1a6e9f15abfcf31 | |
parent | 39cb5d375654be853ac7cbf696b6c4d0393cd846 (diff) | |
download | hardware_libhardware_legacy-17d8e9f041abbf68cfdeea312110856422279566.zip hardware_libhardware_legacy-17d8e9f041abbf68cfdeea312110856422279566.tar.gz hardware_libhardware_legacy-17d8e9f041abbf68cfdeea312110856422279566.tar.bz2 |
wifi: Ensure supplicant stopped in wifi_stop_supplicant
Commit 3674b8ab31a628c5d0834890ba3549bf8badf4ea introduces the
wifi_fst module, with a coding mistake, wifi_stop_supplicant
will return even supplicant is not really stopped.
If wifi_start_supplicant is called immediately, race condition
will happen in init process, which makes supplicant not start.
This change is to ensure supplicant really stopped before
wifi_stop_supplicant return.
CYNGNOS-1833, SAMBAR-1266
Change-Id: Ibcf38023a57971ad6e3064b7ab2a98a7a0ed8b99
CRs-Fixed: 958819
-rw-r--r-- | wifi/wifi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/wifi/wifi.c b/wifi/wifi.c index 00dcf94..6f7e105 100644 --- a/wifi/wifi.c +++ b/wifi/wifi.c @@ -873,9 +873,10 @@ int wifi_stop_supplicant(int p2p_supported) while (count-- > 0) { if (property_get(supplicant_prop_name, supp_status, NULL)) { - if (strcmp(supp_status, "stopped") == 0) + if (strcmp(supp_status, "stopped") == 0) { wifi_stop_fstman(0); return 0; + } } usleep(100000); } |