Skip to contentSkip to conversation

nl80211: fix logic inversion in start_nan()

PATCH In review Johannes Berg 2 participants 3 messages Nov 21, 2016 802.11 (including cfg80211/NL80211)

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 nl80211: fix logic inversion in start_nan()

From: Johannes Berg <[email protected]>

Arend inadvertedly inverted the logic while converting to wdev_running(), fix that.

Fixes 73c7da3dae1e ("cfg80211: add generic helper to check interface is running")
---
 net/wireless/nl80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/nl80211.c +1 -1
index 4e9bda49e957..e4f718e956d7 100644
@@ -10625,7 +10625,7 @@ static int nl80211_start_nan(struct sk_buff *skb, struct genl_info *info)
 	if (wdev->iftype != NL80211_IFTYPE_NAN)
 		return -EOPNOTSUPP;
 
-	if (!wdev_running(wdev))
+	if (wdev_running(wdev))
 		return -EEXIST;
 
 	if (rfkill_blocked(rdev->rfkill))
Signature · 1 line
2.9.3
#1 lore raw
Quoted 4 lines · Johannes Berg

From: Johannes Berg <[email protected]>

Arend inadvertedly inverted the logic while converting to wdev_running(), fix that.

It was indeed inadvertedly.

Thanks,
Arend

Quoted 20 lines
Fixes 73c7da3dae1e ("cfg80211: add generic helper to check interface is running")
---
 net/wireless/nl80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/nl80211.c +1 -1
index 4e9bda49e957..e4f718e956d7 100644
@@ -10625,7 +10625,7 @@ static int nl80211_start_nan(struct sk_buff *skb, struct genl_info *info)
 	if (wdev->iftype != NL80211_IFTYPE_NAN)
 		return -EOPNOTSUPP;
 
-	if (!wdev_running(wdev))
+	if (wdev_running(wdev))
 		return -EEXIST;
 
 	if (rfkill_blocked(rdev->rfkill))
#2 lore raw
Quoted 7 lines · Arend Van Spriel
Quoted 4 lines · Johannes Berg

From: Johannes Berg <[email protected]>

Arend inadvertedly inverted the logic while converting to wdev_running(), fix that.

It was indeed inadvertedly.

Actually spelling checker complains. Should be 'inadvertently'.

Regards,
Arend

Quoted 23 lines

Thanks,
Arend

Quoted 20 lines
Fixes 73c7da3dae1e ("cfg80211: add generic helper to check interface is running")
---
 net/wireless/nl80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/wireless/nl80211.c +1 -1
index 4e9bda49e957..e4f718e956d7 100644
@@ -10625,7 +10625,7 @@ static int nl80211_start_nan(struct sk_buff *skb, struct genl_info *info)
 	if (wdev->iftype != NL80211_IFTYPE_NAN)
 		return -EOPNOTSUPP;
 
-	if (!wdev_running(wdev))
+	if (wdev_running(wdev))
 		return -EEXIST;
 
 	if (rfkill_blocked(rdev->rfkill))