diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-02-10 21:25:57 +0100 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-02-13 19:45:53 +0100 |
commit | 78c1c7e109f1f14e7c18f290c4ebc58da220c7ba (patch) | |
tree | 11d4666d578dc6f9ee4c57dfe3fb4e8498d9ed79 /net/wireless | |
parent | mac80211: dont add BSS when creating IBSS (diff) | |
download | linux-78c1c7e109f1f14e7c18f290c4ebc58da220c7ba.tar.xz linux-78c1c7e109f1f14e7c18f290c4ebc58da220c7ba.zip |
cfg80211: free_priv for BSS info
When cfg80211 users have their own allocated data in the per-BSS
private data, they will need to free this when the BSS struct is
destroyed. Add a free_priv method and fix one place where the BSS
was kfree'd rather than released properly.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/core.c | 2 | ||||
-rw-r--r-- | net/wireless/scan.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/net/wireless/core.c b/net/wireless/core.c index 3cccd1390cea..0668b2bfc1da 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c @@ -376,7 +376,7 @@ void cfg80211_dev_free(struct cfg80211_registered_device *drv) mutex_destroy(&drv->mtx); mutex_destroy(&drv->devlist_mtx); list_for_each_entry_safe(scan, tmp, &drv->bss_list, list) - kfree(scan); + cfg80211_put_bss(&scan->pub); kfree(drv); } diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 009d12810c55..ec148f68a62b 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -56,6 +56,8 @@ static void bss_release(struct kref *ref) struct cfg80211_internal_bss *bss; bss = container_of(ref, struct cfg80211_internal_bss, ref); + if (bss->pub.free_priv) + bss->pub.free_priv(&bss->pub); kfree(bss); } |