linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Ajay.Kathat@microchip.com>
To: <dinghao.liu@zju.edu.cn>, <kjlu@umn.edu>
Cc: <Claudiu.Beznea@microchip.com>, <kvalo@codeaurora.org>,
	<davem@davemloft.net>, <kuba@kernel.org>,
	<Eugen.Hristev@microchip.com>, <gregkh@linuxfoundation.org>,
	<linux-wireless@vger.kernel.org>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] [v2] wilc1000: Fix memleak in wilc_sdio_probe
Date: Thu, 20 Aug 2020 05:56:55 +0000	[thread overview]
Message-ID: <ead9e558-2487-b385-33f9-9c96a360762e@microchip.com> (raw)
In-Reply-To: <20200820054819.23365-1-dinghao.liu@zju.edu.cn>


On 20/08/20 11:18 am, Dinghao Liu wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> When devm_clk_get() returns -EPROBE_DEFER, sdio_priv
> should be freed just like when wilc_cfg80211_init()
> fails.
> 
> Fixes: 8692b047e86cf ("staging: wilc1000: look for rtc_clk clock")
> Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>

Acked-by: Ajay Singh <ajay.kathat@microchip.com>

> ---
> 
> Changelog:
> 
> v2: - Remove 'staging' prefix in subject.
> ---
>  drivers/net/wireless/microchip/wilc1000/sdio.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c
> index 3ece7b0b0392..351ff909ab1c 100644
> --- a/drivers/net/wireless/microchip/wilc1000/sdio.c
> +++ b/drivers/net/wireless/microchip/wilc1000/sdio.c
> @@ -149,9 +149,10 @@ static int wilc_sdio_probe(struct sdio_func *func,
>         wilc->dev = &func->dev;
> 
>         wilc->rtc_clk = devm_clk_get(&func->card->dev, "rtc");
> -       if (PTR_ERR_OR_ZERO(wilc->rtc_clk) == -EPROBE_DEFER)
> +       if (PTR_ERR_OR_ZERO(wilc->rtc_clk) == -EPROBE_DEFER) {
> +               kfree(sdio_priv);
>                 return -EPROBE_DEFER;
> -       else if (!IS_ERR(wilc->rtc_clk))
> +       } else if (!IS_ERR(wilc->rtc_clk))
>                 clk_prepare_enable(wilc->rtc_clk);
> 
>         dev_info(&func->dev, "Driver Initializing success\n");
> --
> 2.17.1
> 

  reply	other threads:[~2020-08-20  5:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-20  5:48 Dinghao Liu
2020-08-20  5:56 ` Ajay.Kathat [this message]
2020-08-25  8:11 ` Claudiu.Beznea
2020-08-27 10:01 ` Kalle Valo

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=ead9e558-2487-b385-33f9-9c96a360762e@microchip.com \
    --to=ajay.kathat@microchip.com \
    --cc=Claudiu.Beznea@microchip.com \
    --cc=Eugen.Hristev@microchip.com \
    --cc=davem@davemloft.net \
    --cc=dinghao.liu@zju.edu.cn \
    --cc=gregkh@linuxfoundation.org \
    --cc=kjlu@umn.edu \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH] [v2] wilc1000: Fix memleak in wilc_sdio_probe' \
    /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

This is a public inbox, see mirroring instructions
on how to clone and mirror all data and code used for this inbox