From: Arik Nemtsov Date: Sun, 14 Aug 2011 10:17:37 +0000 (+0300) Subject: wl12xx: set the AP-started flag only after setting keys X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=cf42039f33c8c7c12f19390661eb00ba47b96f91;p=openwrt%2Fstaging%2Fblogic.git wl12xx: set the AP-started flag only after setting keys This fix eliminates a potential race between starting the AP role and setting encryption keys. Signed-off-by: Arik Nemtsov Signed-off-by: Eliad Peller Signed-off-by: Luciano Coelho --- diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c index ad0b5a163b9d..a23b394291f2 100644 --- a/drivers/net/wireless/wl12xx/main.c +++ b/drivers/net/wireless/wl12xx/main.c @@ -3140,12 +3140,12 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl, if (ret < 0) goto out; - set_bit(WL1271_FLAG_AP_STARTED, &wl->flags); - wl1271_debug(DEBUG_AP, "started AP"); - ret = wl1271_ap_init_hwenc(wl); if (ret < 0) goto out; + + set_bit(WL1271_FLAG_AP_STARTED, &wl->flags); + wl1271_debug(DEBUG_AP, "started AP"); } } else { if (test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) {