From: Jouni Malinen Date: Wed, 14 Jan 2015 22:59:14 +0000 (+0200) Subject: nl80211: Fix AP-scan-in-STA-mode error path behavior X-Git-Tag: hostap_2_4~409 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1fef85c7c5e3d484ff8c6ec92c7e883427ec0c7e;p=thirdparty%2Fhostap.git nl80211: Fix AP-scan-in-STA-mode error path behavior If a second scan trigger attempt fails in STA mode, the error path was supposed to restore the old mode that was in use before changing to STA mode. However, wpa_driver_nl80211_set_mode() changes drv->nlmode on success, so the recovery path needs to use the saved old_mode value instead. Signed-off-by: Jouni Malinen --- diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c index c35b4d7ef..3911f485f 100644 --- a/src/drivers/driver_nl80211_scan.c +++ b/src/drivers/driver_nl80211_scan.c @@ -266,7 +266,7 @@ int wpa_driver_nl80211_scan(struct i802_bss *bss, goto fail; if (wpa_driver_nl80211_scan(bss, params)) { - wpa_driver_nl80211_set_mode(bss, drv->nlmode); + wpa_driver_nl80211_set_mode(bss, old_mode); goto fail; }