From: Kalle Valo <kvalo@codeaurora.org>
To: Colin King <colin.king@canonical.com>
Cc: Amitkumar Karwar <akarwar@marvell.com>,
Nishant Sarmukadam <nishants@marvell.com>,
linux-wireless@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mwifiex: fix memory leak on regd when chan is zero
Date: Thu, 15 Sep 2016 20:10:47 +0300 [thread overview]
Message-ID: <87vaxx9jhk.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <20160915162117.1209-1-colin.king@canonical.com> (Colin King's message of "Thu, 15 Sep 2016 17:21:17 +0100")
Colin King <colin.king@canonical.com> writes:
> From: Colin Ian King <colin.king@canonical.com>
>
> When chan is zero mwifiex_create_custom_regdomain does not kfree
> regd and we have a memory leak. Fix this by freeing regd before
> the return.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
> index 3344a26..15a91f3 100644
> --- a/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
> +++ b/drivers/net/wireless/marvell/mwifiex/sta_cmdresp.c
> @@ -1049,8 +1049,10 @@ mwifiex_create_custom_regdomain(struct mwifiex_private *priv,
> enum nl80211_band band;
>
> chan = *buf++;
> - if (!chan)
> + if (!chan) {
> + kfree(regd);
> return NULL;
> + }
Bob sent a similar fix and he also did more:
mwifiex: fix error handling in mwifiex_create_custom_regdomain
https://patchwork.kernel.org/patch/9331337/
--
Kalle Valo
next prev parent reply other threads:[~2016-09-15 17:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-15 16:21 [PATCH] mwifiex: fix memory leak on regd when chan is zero Colin King
2016-09-15 17:10 ` Kalle Valo [this message]
2016-09-15 17:26 ` Colin Ian King
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=87vaxx9jhk.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@codeaurora.org \
--cc=akarwar@marvell.com \
--cc=colin.king@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nishants@marvell.com \
/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