linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] crypto: hifn_795x - Fix a memory leak in the error handling path of 'hifn_probe()'
@ 2017-11-18 13:45 Christophe JAILLET
  2017-11-20 15:09 ` PrasannaKumar Muralidharan
  2017-11-29  6:38 ` Herbert Xu
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2017-11-18 13:45 UTC (permalink / raw)
  To: herbert, davem
  Cc: linux-crypto, linux-kernel, kernel-janitors, Christophe JAILLET

'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@wanadoo.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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: hifn_795x - Fix a memory leak in the error handling path of 'hifn_probe()'
  2017-11-18 13:45 [PATCH] crypto: hifn_795x - Fix a memory leak in the error handling path of 'hifn_probe()' Christophe JAILLET
@ 2017-11-20 15:09 ` PrasannaKumar Muralidharan
  2017-11-29  6:38 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: PrasannaKumar Muralidharan @ 2017-11-20 15:09 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Herbert Xu, David S . Miller,
	open list:HARDWARE RANDOM NUMBER GENERATOR CORE, open list,
	kernel-janitors

Hi Christophe,

On 18 November 2017 at 19:15, Christophe JAILLET
<christophe.jaillet@wanadoo.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@wanadoo.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@gmail.com>

Regards,
PrasannaKumar

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] crypto: hifn_795x - Fix a memory leak in the error handling path of 'hifn_probe()'
  2017-11-18 13:45 [PATCH] crypto: hifn_795x - Fix a memory leak in the error handling path of 'hifn_probe()' Christophe JAILLET
  2017-11-20 15:09 ` PrasannaKumar Muralidharan
@ 2017-11-29  6:38 ` Herbert Xu
  1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2017-11-29  6:38 UTC (permalink / raw)
  To: Christophe JAILLET; +Cc: davem, linux-crypto, linux-kernel, kernel-janitors

On Sat, Nov 18, 2017 at 02:45:45PM +0100, Christophe JAILLET 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@wanadoo.fr>

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-29  6:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-18 13:45 [PATCH] crypto: hifn_795x - Fix a memory leak in the error handling path of 'hifn_probe()' Christophe JAILLET
2017-11-20 15:09 ` PrasannaKumar Muralidharan
2017-11-29  6:38 ` Herbert Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).