* [PATCH] rsi: fix memory leak in module unload
@ 2016-09-21 8:39 Prameela Rani Garnepudi
2016-10-12 14:22 ` Kalle Valo
0 siblings, 1 reply; 2+ messages in thread
From: Prameela Rani Garnepudi @ 2016-09-21 8:39 UTC (permalink / raw)
To: linux-wireless
Cc: kvalo, johannes.berg, hofrat, xypron.glpk, prameela.garnepudi,
Prameela Rani Garnepudi
debugfs entry removal statement moved inside CONFIG_RSI_DEBUGSFS flag
added freeing of below structures
* channel list for each supported band
* rsi debugfs info
Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
---
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] rsi: fix memory leak in module unload
2016-09-21 8:39 [PATCH] rsi: fix memory leak in module unload Prameela Rani Garnepudi
@ 2016-10-12 14:22 ` Kalle Valo
0 siblings, 0 replies; 2+ messages in thread
From: Kalle Valo @ 2016-10-12 14:22 UTC (permalink / raw)
To: Prameela Rani Garnepudi
Cc: linux-wireless, johannes.berg, hofrat, xypron.glpk, prameela.garnepudi
Prameela Rani Garnepudi <prameela.j04cs@gmail.com> writes:
> debugfs entry removal statement moved inside CONFIG_RSI_DEBUGSFS flag
> added freeing of below structures
> * channel list for each supported band
> * rsi debugfs info
>
> Signed-off-by: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
[...]
> --- 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);
> + }
Like Arend already mentioned[1] you should use NUM_NL80211_BANDS here
instead of hardcoded value. Yes, that will also go through
NL80211_BAND_60GHZ item but it doesn't matter as it should be empty
anyway.
[1] https://patchwork.kernel.org/patch/9341095/
--
Kalle Valo
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-12 14:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-21 8:39 [PATCH] rsi: fix memory leak in module unload Prameela Rani Garnepudi
2016-10-12 14:22 ` Kalle Valo
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.