wlcore: correctly check state before regdomain conf
The wlcore state was checked without the mutex being taken. This leads to WARN_ONs sometimes if a notification arrives when the driver is on, but the mutex is only taken after it is off. This usually happens if stopping the driver while connected to a network. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
This commit is contained in:
committed by
Luciano Coelho
parent
0e752df6fd
commit
75592be5e3
@@ -108,7 +108,6 @@ static void wl1271_reg_notify(struct wiphy *wiphy,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (likely(wl->state == WLCORE_STATE_ON))
|
|
||||||
wlcore_regdomain_config(wl);
|
wlcore_regdomain_config(wl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3364,6 +3363,10 @@ void wlcore_regdomain_config(struct wl1271 *wl)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
mutex_lock(&wl->mutex);
|
mutex_lock(&wl->mutex);
|
||||||
|
|
||||||
|
if (unlikely(wl->state != WLCORE_STATE_ON))
|
||||||
|
goto out;
|
||||||
|
|
||||||
ret = wl1271_ps_elp_wakeup(wl);
|
ret = wl1271_ps_elp_wakeup(wl);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|||||||
Reference in New Issue
Block a user