]> git.ipfire.org Git - thirdparty/linux.git/commit
crypto: scompress - Fix scratch allocation failure handling
authorHerbert Xu <herbert@gondor.apana.org.au>
Sat, 15 Mar 2025 12:37:36 +0000 (20:37 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 Mar 2025 09:39:05 +0000 (17:39 +0800)
commitddd0a42671c0d9742fda97d26068ffbb51dd7c01
tree8b95eb4431a0e095c6bf1def8dfa3d76de251308
parent7e0969bae493b346e62293d46dd965c545635f52
crypto: scompress - Fix scratch allocation failure handling

If the scratch allocation fails, all subsequent allocations will
silently succeed without actually allocating anything.  Fix this
by only incrementing users when the allocation succeeds.

Fixes: 6a8487a1f29f ("crypto: scompress - defer allocation of scratch buffer to first use")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/scompress.c