]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
crypto: acomp - Add missing return statements in compress/decompress
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 18 Apr 2025 02:52:34 +0000 (10:52 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sat, 19 Apr 2025 03:18:28 +0000 (11:18 +0800)
The return statements were missing which causes REQ_CHAIN algorithms
to execute twice for every request.

Reported-by: Eric Biggers <ebiggers@kernel.org>
Fixes: 64929fe8c0a4 ("crypto: acomp - Remove request chaining")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/acompress.c

index b0f9192f6b2eb47200b06ff87744a8d22ef17a29..4c665c6fb5d63102942ce4821e7c037dbaa0e97c 100644 (file)
@@ -292,7 +292,7 @@ int crypto_acomp_compress(struct acomp_req *req)
        if (acomp_req_on_stack(req) && acomp_is_async(tfm))
                return -EAGAIN;
        if (crypto_acomp_req_chain(tfm) || acomp_request_issg(req))
-               crypto_acomp_reqtfm(req)->compress(req);
+               return crypto_acomp_reqtfm(req)->compress(req);
        return acomp_do_req_chain(req, true);
 }
 EXPORT_SYMBOL_GPL(crypto_acomp_compress);
@@ -304,7 +304,7 @@ int crypto_acomp_decompress(struct acomp_req *req)
        if (acomp_req_on_stack(req) && acomp_is_async(tfm))
                return -EAGAIN;
        if (crypto_acomp_req_chain(tfm) || acomp_request_issg(req))
-               crypto_acomp_reqtfm(req)->decompress(req);
+               return crypto_acomp_reqtfm(req)->decompress(req);
        return acomp_do_req_chain(req, false);
 }
 EXPORT_SYMBOL_GPL(crypto_acomp_decompress);