[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANc+2y6kih23rAmDg6eqrGQDWAj3iM7_b40KS77QpB-M2Vd76g@mail.gmail.com>
Date: Mon, 20 Nov 2017 20:39:48 +0530
From: PrasannaKumar Muralidharan <prasannatsmkumar@...il.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
"David S . Miller" <davem@...emloft.net>,
"open list:HARDWARE RANDOM NUMBER GENERATOR CORE"
<linux-crypto@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] crypto: hifn_795x - Fix a memory leak in the error
handling path of 'hifn_probe()'
Hi Christophe,
On 18 November 2017 at 19:15, Christophe JAILLET
<christophe.jaillet@...adoo.fr> wrote:
> 'dev' is leaking in the error handling path of 'hifn_probe()'.
>
> Add a 'kfree(dev)' to match the code in 'hifn_remove()'
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> drivers/crypto/hifn_795x.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
> index e09d4055b19e..a5a36fe7bf2c 100644
> --- a/drivers/crypto/hifn_795x.c
> +++ b/drivers/crypto/hifn_795x.c
> @@ -2579,6 +2579,7 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
> for (i = 0; i < 3; ++i)
> if (dev->bar[i])
> iounmap(dev->bar[i]);
> + kfree(dev);
>
> err_out_free_regions:
> pci_release_regions(pdev);
> --
> 2.14.1
>
Nice catch.
Reviewed-by: PrasannaKumar Muralidharan <prasannatsmkumar@...il.com>
Regards,
PrasannaKumar
Powered by blists - more mailing lists