lkml.org 
[lkml]   [2011]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] rfc4106, Intel, AES-NI: Don't leak memory in rfc4106_set_hash_subkey().
On Sun, Jan 16, 2011 at 03:38:47PM +0100, Jesper Juhl wrote:
> There's a small memory leak in
> arch/x86/crypto/aesni-intel_glue.c::rfc4106_set_hash_subkey(). If the call
> to kmalloc() fails and returns NULL then the memory allocated previously
> by ablkcipher_request_alloc() is not freed when we leave the function.
>
> I could have just added a call to ablkcipher_request_free() before we
> return -ENOMEM, but that started to look too much like the code we
> already had at the end of the function, so I chose instead to rework the
> code a bit so that there are now a few labels at the end that we goto when
> various allocations fail, so we don't have to repeat the same blocks of
> code (this also reduces the object code size slightly).
>
> Please review and consider merging.
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>

Patch applied. Thanks a lot!
--
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


\
 
 \ /
  Last update: 2011-01-23 08:59    [W:0.082 / U:7.596 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site