@@ -28,14 +28,17 @@
static bool ath11k_regdom_changes(struct ath11k *ar, char *alpha2)
{
+ const struct ieee80211_regdomain *regd;
+
+ regd = rcu_dereference_rtnl(ar->hw->wiphy->regd);
/* This can happen during wiphy registration where the previous
* user request is received before we update the regd received
* from firmware.
*/
- if (!ar->hw->wiphy->regd)
+ if (!regd)
return true;
- return !!(memcmp(ar->hw->wiphy->regd->alpha2, alpha2, 2));
+ return !!(memcmp(regd->alpha2, alpha2, 2));
}
static void
Access wiphy->regd through rcu dereference API. This also fixes below sparse warning drivers/net/wireless/ath/ath11k/reg.c:38:39: warning: incorrect type in argument 1 (different address spaces) drivers/net/wireless/ath/ath11k/reg.c:38:39: expected void const * drivers/net/wireless/ath/ath11k/reg.c:38:39: got char const [noderef] <asn:4> * Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@codeaurora.org> --- drivers/net/wireless/ath/ath11k/reg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)