Since cfg80211_chandef_dfs_required() can return error number(e.g., -EINVAL), it's not sufficient to just check if it didn't return zero. Fixes: 9e0e29615a20 ("cfg80211: consider existing DFS interfaces") Signed-off-by: Zhao, Gang <gamerh2o@xxxxxxxxx> --- net/wireless/chan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 9c9501a..2cfff9e 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -744,7 +744,7 @@ cfg80211_get_chan_state(struct wireless_dev *wdev, *chanmode = CHAN_MODE_SHARED; if (cfg80211_chandef_dfs_required(wdev->wiphy, - &wdev->chandef)) + &wdev->chandef) > 0) *radar_detect |= BIT(wdev->chandef.width); } return; @@ -754,7 +754,7 @@ cfg80211_get_chan_state(struct wireless_dev *wdev, *chanmode = CHAN_MODE_SHARED; if (cfg80211_chandef_dfs_required(wdev->wiphy, - &wdev->chandef)) + &wdev->chandef) > 0) *radar_detect |= BIT(wdev->chandef.width); } return; -- 1.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html