summaryrefslogtreecommitdiff
path: root/net/wireless/ibss.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless/ibss.c')
-rw-r--r--net/wireless/ibss.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c
index c92b542d54b0..a5330c5a5477 100644
--- a/net/wireless/ibss.c
+++ b/net/wireless/ibss.c
@@ -92,8 +92,12 @@ void cfg80211_clear_ibss(struct net_device *dev, bool nowext)
int cfg80211_leave_ibss(struct cfg80211_registered_device *rdev,
struct net_device *dev, bool nowext)
{
+ struct wireless_dev *wdev = dev->ieee80211_ptr;
int err;
+ if (!wdev->ssid_len)
+ return -ENOLINK;
+
err = rdev->ops->leave_ibss(&rdev->wiphy, dev);
if (err)