Skip to content

Commit 2215914

Browse files
nscndjmberg-intel
authored andcommitted
wifi: nl80211: fix nl80211_start_radar_detection return value
Since the wiphy_guard changes, rdev_start_radar_detection's return value in nl80211_start_radar_detection is ignored and we always returned 0. Fixes: f42d22d ("wifi: cfg80211: define and use wiphy guard") Signed-off-by: Nicolas Escande <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent 9add053 commit 2215914

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

net/wireless/nl80211.c

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10159,25 +10159,26 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
1015910159

1016010160
err = rdev_start_radar_detection(rdev, dev, &chandef, cac_time_ms,
1016110161
link_id);
10162-
if (!err) {
10163-
switch (wdev->iftype) {
10164-
case NL80211_IFTYPE_AP:
10165-
case NL80211_IFTYPE_P2P_GO:
10166-
wdev->links[0].ap.chandef = chandef;
10167-
break;
10168-
case NL80211_IFTYPE_ADHOC:
10169-
wdev->u.ibss.chandef = chandef;
10170-
break;
10171-
case NL80211_IFTYPE_MESH_POINT:
10172-
wdev->u.mesh.chandef = chandef;
10173-
break;
10174-
default:
10175-
break;
10176-
}
10177-
wdev->links[link_id].cac_started = true;
10178-
wdev->links[link_id].cac_start_time = jiffies;
10179-
wdev->links[link_id].cac_time_ms = cac_time_ms;
10162+
if (err)
10163+
return err;
10164+
10165+
switch (wdev->iftype) {
10166+
case NL80211_IFTYPE_AP:
10167+
case NL80211_IFTYPE_P2P_GO:
10168+
wdev->links[0].ap.chandef = chandef;
10169+
break;
10170+
case NL80211_IFTYPE_ADHOC:
10171+
wdev->u.ibss.chandef = chandef;
10172+
break;
10173+
case NL80211_IFTYPE_MESH_POINT:
10174+
wdev->u.mesh.chandef = chandef;
10175+
break;
10176+
default:
10177+
break;
1018010178
}
10179+
wdev->links[link_id].cac_started = true;
10180+
wdev->links[link_id].cac_start_time = jiffies;
10181+
wdev->links[link_id].cac_time_ms = cac_time_ms;
1018110182

1018210183
return 0;
1018310184
}

0 commit comments

Comments
 (0)