diff options
author | David S. Miller <davem@davemloft.net> | 2009-02-14 23:06:44 -0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-14 23:06:44 -0800 |
commit | ac178ef0ae9eb44fd527d87aa9b6394e05f56e1f (patch) | |
tree | 5d6bd46ecf9ce989134d3c460e1ecf5dd1fceadc /net/wireless/core.c | |
parent | f3a7c66b5ce0b75a9774a50b5dcce93e5ba28370 (diff) | |
parent | 6d08b9b9c6eb2414c4a037407dd121298a74fb36 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'net/wireless/core.c')
-rw-r--r-- | net/wireless/core.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index 12522647608..0668b2bfc1d 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -240,6 +240,8 @@ struct wiphy *wiphy_new(struct cfg80211_ops *ops, int sizeof_priv) mutex_init(&drv->mtx); mutex_init(&drv->devlist_mtx); INIT_LIST_HEAD(&drv->netdev_list); + spin_lock_init(&drv->bss_lock); + INIT_LIST_HEAD(&drv->bss_list); device_initialize(&drv->wiphy.dev); drv->wiphy.dev.class = &ieee80211_class; @@ -259,6 +261,9 @@ int wiphy_register(struct wiphy *wiphy) int i; u16 ifmodes = wiphy->interface_modes; + if (WARN_ON(wiphy->max_scan_ssids < 1)) + return -EINVAL; + /* sanity check ifmodes */ WARN_ON(!ifmodes); ifmodes &= ((1 << __NL80211_IFTYPE_AFTER_LAST) - 1) & ~1; @@ -367,8 +372,11 @@ EXPORT_SYMBOL(wiphy_unregister); void cfg80211_dev_free(struct cfg80211_registered_device *drv) { + struct cfg80211_internal_bss *scan, *tmp; mutex_destroy(&drv->mtx); mutex_destroy(&drv->devlist_mtx); + list_for_each_entry_safe(scan, tmp, &drv->bss_list, list) + cfg80211_put_bss(&scan->pub); kfree(drv); } |