Linux wireless drivers development
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Prameela Rani Garnepudi <prameela.j04cs@gmail.com>
Cc: linux-wireless@vger.kernel.org, johannes.berg@intel.com,
	hofrat@osadl.org, xypron.glpk@gmx.de,
	prameela.garnepudi@redpinesignals.com
Subject: Re: [PATCH] rsi: fix memory leak in module unload
Date: Wed, 12 Oct 2016 17:22:12 +0300	[thread overview]
Message-ID: <87oa2pejfv.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1474447162-19956-1-git-send-email-prameela.j04cs@gmail.com> (Prameela Rani Garnepudi's message of "Wed, 21 Sep 2016 14:09:22 +0530")

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

      reply	other threads:[~2016-10-12 14:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-21  8:39 [PATCH] rsi: fix memory leak in module unload Prameela Rani Garnepudi
2016-10-12 14:22 ` Kalle Valo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oa2pejfv.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@codeaurora.org \
    --cc=hofrat@osadl.org \
    --cc=johannes.berg@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=prameela.garnepudi@redpinesignals.com \
    --cc=prameela.j04cs@gmail.com \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox