Skip to content

Commit 04053e5

Browse files
IssamHamdigregkh
authored andcommitted
wifi: cfg80211: Set correct chandef when starting CAC
[ Upstream commit 2036171 ] When starting CAC in a mode other than AP mode, it return a "WARNING: CPU: 0 PID: 63 at cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211]" caused by the chandef.chan being null at the end of CAC. Solution: Ensure the channel definition is set for the different modes when starting CAC to avoid getting a NULL 'chan' at the end of CAC. Call Trace: ? show_regs.part.0+0x14/0x16 ? __warn+0x67/0xc0 ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] ? report_bug+0xa7/0x130 ? exc_overflow+0x30/0x30 ? handle_bug+0x27/0x50 ? exc_invalid_op+0x18/0x60 ? handle_exception+0xf6/0xf6 ? exc_overflow+0x30/0x30 ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] ? exc_overflow+0x30/0x30 ? cfg80211_chandef_dfs_usable+0x20/0xaf [cfg80211] ? regulatory_propagate_dfs_state.cold+0x1b/0x4c [cfg80211] ? cfg80211_propagate_cac_done_wk+0x1a/0x30 [cfg80211] ? process_one_work+0x165/0x280 ? worker_thread+0x120/0x3f0 ? kthread+0xc2/0xf0 ? process_one_work+0x280/0x280 ? kthread_complete_and_exit+0x20/0x20 ? ret_from_fork+0x19/0x24 Reported-by: Kretschmer Mathias <[email protected]> Signed-off-by: Issam Hamdi <[email protected]> Link: https://patch.msgid.link/[email protected] [shorten subject, remove OCB, reorder cases to match previous list] Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent d76360a commit 04053e5

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

net/wireless/nl80211.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10048,7 +10048,20 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
1004810048

1004910049
err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms);
1005010050
if (!err) {
10051-
wdev->links[0].ap.chandef = chandef;
10051+
switch (wdev->iftype) {
10052+
case NL80211_IFTYPE_AP:
10053+
case NL80211_IFTYPE_P2P_GO:
10054+
wdev->links[0].ap.chandef = chandef;
10055+
break;
10056+
case NL80211_IFTYPE_ADHOC:
10057+
wdev->u.ibss.chandef = chandef;
10058+
break;
10059+
case NL80211_IFTYPE_MESH_POINT:
10060+
wdev->u.mesh.chandef = chandef;
10061+
break;
10062+
default:
10063+
break;
10064+
}
1005210065
wdev->cac_started = true;
1005310066
wdev->cac_start_time = jiffies;
1005410067
wdev->cac_time_ms = cac_time_ms;

0 commit comments

Comments
 (0)