OSDN Git Service

crypto: scompress - free partially allocated scratch buffers on failure
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 21 Jul 2017 15:42:37 +0000 (16:42 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 3 Aug 2017 05:52:44 +0000 (13:52 +0800)
commitcc4d110ec824d3f05f95b1f705158afc6fb08773
tree8c09c9f195f61aca2f240efc71dd229cf50e38ed
parent3c08377262880afc1621ab9cb6dbe7df47a6033d
crypto: scompress - free partially allocated scratch buffers on failure

When allocating the per-CPU scratch buffers, we allocate the source
and destination buffers separately, but bail immediately if the second
allocation fails, without freeing the first one. Fix that.

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/scompress.c