From: Shaul Triebitz Date: Mon, 1 Aug 2022 11:12:29 +0000 (+0300) Subject: wifi: cfg80211: get correct AP link chandef X-Git-Tag: v6.1-rc1~170^2~329^2~28 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bc1857619cc7612117d2ee1ed05b5bfeb638614b;p=thirdparty%2Fkernel%2Flinux.git wifi: cfg80211: get correct AP link chandef When checking for channel regulatory validity, use the AP link chandef (and not mesh's chandef). Fixes: 7b0a0e3c3a88 ("wifi: cfg80211: do some rework towards MLO link APIs") Signed-off-by: Shaul Triebitz Signed-off-by: Johannes Berg --- diff --git a/net/wireless/reg.c b/net/wireless/reg.c index c7383ede794fc..d5c7a5aa68532 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -2389,6 +2389,10 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) switch (iftype) { case NL80211_IFTYPE_AP: case NL80211_IFTYPE_P2P_GO: + if (!wdev->links[link].ap.beacon_interval) + continue; + chandef = wdev->links[link].ap.chandef; + break; case NL80211_IFTYPE_MESH_POINT: if (!wdev->u.mesh.beacon_interval) continue;