Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf42039f authored by Arik Nemtsov's avatar Arik Nemtsov Committed by Luciano Coelho
Browse files

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: default avatarArik Nemtsov <arik@wizery.com>
Signed-off-by: default avatarEliad Peller <eliad@wizery.com>
Signed-off-by: default avatarLuciano Coelho <coelho@ti.com>
parent 9b17f1b3
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -3140,12 +3140,12 @@ static void wl1271_bss_info_changed_ap(struct wl1271 *wl,
				if (ret < 0)
				if (ret < 0)
					goto out;
					goto out;


				set_bit(WL1271_FLAG_AP_STARTED, &wl->flags);
				wl1271_debug(DEBUG_AP, "started AP");

				ret = wl1271_ap_init_hwenc(wl);
				ret = wl1271_ap_init_hwenc(wl);
				if (ret < 0)
				if (ret < 0)
					goto out;
					goto out;

				set_bit(WL1271_FLAG_AP_STARTED, &wl->flags);
				wl1271_debug(DEBUG_AP, "started AP");
			}
			}
		} else {
		} else {
			if (test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) {
			if (test_bit(WL1271_FLAG_AP_STARTED, &wl->flags)) {