From: "Valo, Kalle" <kvalo@qca.qualcomm.com>
To: Colin King <colin.king@canonical.com>
Cc: "ath10k@lists.infradead.org" <ath10k@lists.infradead.org>,
"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] ath10k: fix memory leak on caldata on error exit path
Date: Fri, 2 Sep 2016 15:45:09 +0000 [thread overview]
Message-ID: <87r392z4ox.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <1471268785-11576-1-git-send-email-colin.king@canonical.com> (Colin King's message of "Mon, 15 Aug 2016 14:46:25 +0100")
Colin King <colin.king@canonical.com> writes:
> From: Colin Ian King <colin.king@canonical.com>
>
> caldata is not being free'd on the error exit path, causing
> a memory leak. kfree it to fix the leak.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/net/wireless/ath/ath10k/pci.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless=
/ath/ath10k/pci.c
> index 9a22c47..886337c 100644
> --- a/drivers/net/wireless/ath/ath10k/pci.c
> +++ b/drivers/net/wireless/ath/ath10k/pci.c
> @@ -2725,6 +2725,7 @@ static int ath10k_pci_hif_fetch_cal_eeprom(struct a=
th10k *ar, void **data,
> return 0;
> =20
> err_free:
> + kfree(caldata);
> kfree(data);
> =20
> return -EINVAL;
I don't think we should free data at all:
static int ath10k_download_cal_eeprom(struct ath10k *ar)
{
size_t data_len;
void *data =3D NULL;
int ret;
ret =3D ath10k_hif_fetch_cal_eeprom(ar, &data, &data_len);
Instead we should free only caldata, right?
--=20
Kalle Valo=
next prev parent reply other threads:[~2016-09-02 15:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-15 13:46 [PATCH] ath10k: fix memory leak on caldata on error exit path Colin King
2016-09-02 15:45 ` Valo, Kalle [this message]
2016-09-03 16:33 ` 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=87r392z4ox.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@qca.qualcomm.com \
--cc=ath10k@lists.infradead.org \
--cc=colin.king@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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