]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/wireless/core.c
Merge tag 'dm-4.11-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/device...
[karo-tx-linux.git] / net / wireless / core.c
index 158c59ecf90a35a6af8ca353c7583e0bd0cda807..e55e05bc48053f5542696a4c2d53170dfd02577c 100644 (file)
@@ -626,7 +626,8 @@ int wiphy_register(struct wiphy *wiphy)
 
        if (WARN_ON((wiphy->interface_modes & BIT(NL80211_IFTYPE_NAN)) &&
                    (!rdev->ops->start_nan || !rdev->ops->stop_nan ||
-                    !rdev->ops->add_nan_func || !rdev->ops->del_nan_func)))
+                    !rdev->ops->add_nan_func || !rdev->ops->del_nan_func ||
+                    !(wiphy->nan_supported_bands & BIT(NL80211_BAND_2GHZ)))))
                return -EINVAL;
 
 #ifndef CONFIG_WIRELESS_WDS
@@ -1142,6 +1143,8 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
                     wdev->iftype == NL80211_IFTYPE_ADHOC) && !wdev->use_4addr)
                        dev->priv_flags |= IFF_DONT_BRIDGE;
 
+               INIT_WORK(&wdev->disconnect_wk, cfg80211_autodisconnect_wk);
+
                nl80211_notify_iface(rdev, wdev, NL80211_CMD_NEW_INTERFACE);
                break;
        case NETDEV_GOING_DOWN:
@@ -1230,6 +1233,7 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb,
 #ifdef CONFIG_CFG80211_WEXT
                        kzfree(wdev->wext.keys);
 #endif
+                       flush_work(&wdev->disconnect_wk);
                }
                /*
                 * synchronise (so that we won't find this netdev