wifi: cfg80211: get correct AP link chandef

[ Upstream commit bc1857619c ]

When checking for channel regulatory validity, use the
AP link chandef (and not mesh's chandef).

Fixes: 7b0a0e3c3a ("wifi: cfg80211: do some rework towards MLO link APIs")
Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Shaul Triebitz 2022-08-01 14:12:29 +03:00 committed by Greg Kroah-Hartman
parent caa176c095
commit a43b2d1218
1 changed files with 4 additions and 0 deletions

View File

@ -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;