2016-09-21 06:02:36

by Prameela Rani Garnepudi

[permalink] [raw]
Subject: [PATCH] rsi: fix memory lean in module unload

Moved debugfs entry removal under CONFIG_RSI_DEBUGFS flag
Added freeing of below structures
* channels list in each supported band
* rsi debugfs info

Signed-off-by: Prameela Rani Garnepudi <[email protected]>
---
drivers/net/wireless/rsi/rsi_91x_mac80211.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
index dbb2389..f4bbf15 100644
--- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c
+++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c
@@ -194,6 +194,7 @@ static void rsi_register_rates_channels(struct rsi_hw *adapter, int band)
void rsi_mac80211_detach(struct rsi_hw *adapter)
{
struct ieee80211_hw *hw = adapter->hw;
+ enum nl80211_band band;

if (hw) {
ieee80211_stop_queues(hw);
@@ -201,7 +202,17 @@ void rsi_mac80211_detach(struct rsi_hw *adapter)
ieee80211_free_hw(hw);
}

+ for (band = 0; band < 2; band++) {
+ struct ieee80211_supported_band *sband =
+ &adapter->sbands[band];
+
+ kfree(sband->channels);
+ }
+
+#ifdef CONFIG_RSI_DEBUGFS
rsi_remove_dbgfs(adapter);
+ kfree(adapter->dfsentry);
+#endif
}
EXPORT_SYMBOL_GPL(rsi_mac80211_detach);

--
2.4.11


2016-10-12 14:15:27

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] rsi: fix memory lean in module unload

Prameela Rani Garnepudi <[email protected]> writes:

> Moved debugfs entry removal under CONFIG_RSI_DEBUGFS flag
> Added freeing of below structures
> * channels list in each supported band
> * rsi debugfs info
>
> Signed-off-by: Prameela Rani Garnepudi <[email protected]>

There are four similar patches without any version information:

[ 1] rsi: fix memory leak in debugfs entry and supported bands 2016-09-19 Prameela Ran Deferred
[ 2] [1/1] rsi: fix memory leak in debugfs entry and supported... 2016-09-20 Prameela Ran Deferred
[ 3] rsi: fix memory lean in module unload 2016-09-21 Prameela Ran Deferred
[ 4] rsi: fix memory leak in module unload 2016-09-21 Prameela Ran Deferred

When sending a new version of the patch please add a version number to
it. See the instructions for more:

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches#subject_name

--
Kalle Valo