]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: hmac - fix memory leak in hmac_init_tfm()
authorEric Biggers <ebiggers@google.com>
Wed, 22 May 2019 19:42:29 +0000 (12:42 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 30 May 2019 07:25:57 +0000 (15:25 +0800)
commitd22adefa401e65fd407f7355aefc6b4bcdba9a2b
treef15fd92cbf013eb8e31c422457593b674e46aae1
parent319d7aec7fb8b8fc39a62658c02485cce4925856
crypto: hmac - fix memory leak in hmac_init_tfm()

When I added the sanity check of 'descsize', I missed that the child
hash tfm needs to be freed if the sanity check fails.  Of course this
should never happen, hence the use of WARN_ON(), but it should be fixed.

Fixes: 70cc499cf4b4 ("crypto: hash - fix incorrect HASH_MAX_DESCSIZE")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/hmac.c