summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/cfg80211.h2
-rw-r--r--net/wireless/core.c2
-rw-r--r--net/wireless/scan.c2
3 files changed, 5 insertions, 1 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 09a0b268e5c..b514abcc2b9 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -567,6 +567,7 @@ enum cfg80211_signal_type {
* @len_information_elements: total length of the information elements
* @signal: signal strength value
* @signal_type: signal type
+ * @free_priv: function pointer to free private data
* @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
*/
struct cfg80211_bss {
@@ -582,6 +583,7 @@ struct cfg80211_bss {
s32 signal;
enum cfg80211_signal_type signal_type;
+ void (*free_priv)(struct cfg80211_bss *bss);
u8 priv[0] __attribute__((__aligned__(sizeof(void *))));
};
diff --git a/net/wireless/core.c b/net/wireless/core.c
index 3cccd1390ce..0668b2bfc1d 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 009d12810c5..ec148f68a62 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);
}