All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: dh - fix memory leak
@ 2018-07-10 14:22 Gustavo A. R. Silva
  2018-07-10 15:28 ` Stephan Müller
  2018-07-20  5:53 ` Herbert Xu
  0 siblings, 2 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-07-10 14:22 UTC (permalink / raw)
  To: Stephan Mueller, Herbert Xu, David S. Miller
  Cc: linux-crypto, linux-kernel, Gustavo A. R. Silva

In case memory resources for *base* were allocated, release them
before return.

Addresses-Coverity-ID: 1471702 ("Resource leak")
Fixes: e3fe0ae12962 ("crypto: dh - add public key verification test")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
---
 crypto/dh.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/dh.c b/crypto/dh.c
index 8f79269..09a44de 100644
--- a/crypto/dh.c
+++ b/crypto/dh.c
@@ -174,7 +174,7 @@ static int dh_compute_value(struct kpp_request *req)
 		}
 		ret = dh_is_pubkey_valid(ctx, base);
 		if (ret)
-			goto err_free_val;
+			goto err_free_base;
 	} else {
 		base = ctx->g;
 	}
-- 
2.7.4

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

* Re: [PATCH] crypto: dh - fix memory leak
  2018-07-10 14:22 [PATCH] crypto: dh - fix memory leak Gustavo A. R. Silva
@ 2018-07-10 15:28 ` Stephan Müller
  2018-07-10 16:49   ` Gustavo A. R. Silva
  2018-07-20  5:53 ` Herbert Xu
  1 sibling, 1 reply; 4+ messages in thread
From: Stephan Müller @ 2018-07-10 15:28 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Herbert Xu, David S. Miller, linux-crypto, linux-kernel

Am Dienstag, 10. Juli 2018, 16:22:52 CEST schrieb Gustavo A. R. Silva:

Hi Gustavo,

> In case memory resources for *base* were allocated, release them
> before return.

Thanks a lot.

Reviewed-by: Stephan Müller <smueller@chronox.de>

Ciao
Stephan

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

* Re: [PATCH] crypto: dh - fix memory leak
  2018-07-10 15:28 ` Stephan Müller
@ 2018-07-10 16:49   ` Gustavo A. R. Silva
  0 siblings, 0 replies; 4+ messages in thread
From: Gustavo A. R. Silva @ 2018-07-10 16:49 UTC (permalink / raw)
  To: Stephan Müller
  Cc: Herbert Xu, David S. Miller, linux-crypto, linux-kernel

Hi Stephan,

On 07/10/2018 10:28 AM, Stephan Müller wrote:
> Am Dienstag, 10. Juli 2018, 16:22:52 CEST schrieb Gustavo A. R. Silva:
> 
> Hi Gustavo,
> 
>> In case memory resources for *base* were allocated, release them
>> before return.
> 
> Thanks a lot.
> 

Glad to help. :)

> Reviewed-by: Stephan Müller <smueller@chronox.de>
> 

Thanks
--
Gustavo

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

* Re: [PATCH] crypto: dh - fix memory leak
  2018-07-10 14:22 [PATCH] crypto: dh - fix memory leak Gustavo A. R. Silva
  2018-07-10 15:28 ` Stephan Müller
@ 2018-07-20  5:53 ` Herbert Xu
  1 sibling, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2018-07-20  5:53 UTC (permalink / raw)
  To: Gustavo A. R. Silva
  Cc: Stephan Mueller, David S. Miller, linux-crypto, linux-kernel

On Tue, Jul 10, 2018 at 09:22:52AM -0500, Gustavo A. R. Silva wrote:
> In case memory resources for *base* were allocated, release them
> before return.
> 
> Addresses-Coverity-ID: 1471702 ("Resource leak")
> Fixes: e3fe0ae12962 ("crypto: dh - add public key verification test")
> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>

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] 4+ messages in thread

end of thread, other threads:[~2018-07-20  5:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-10 14:22 [PATCH] crypto: dh - fix memory leak Gustavo A. R. Silva
2018-07-10 15:28 ` Stephan Müller
2018-07-10 16:49   ` Gustavo A. R. Silva
2018-07-20  5:53 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.