diff mbox series

crypto: acomp - Add missing return statements in compress/decompress

Message ID aAG-chUuldQisBIA@gondor.apana.org.au
State New
Headers show
Series crypto: acomp - Add missing return statements in compress/decompress | expand

Commit Message

Herbert Xu April 18, 2025, 2:52 a.m. UTC
On Thu, Apr 17, 2025 at 11:39:27AM -0700, Eric Biggers wrote:
>
> And this series does not apply to current cryptodev/master.
> 
> So there's no way to apply this series to review it.

Yes it's conflicting with the powerpc uaccess patch.  I'll repost.

> I think the high-level idea is still suspect, as I said before.  Especially for
> sha256 and sha512 which I will be fixing to have proper library APIs.  I don't
> think it's particularly helpful to be futzing around with how those are
> integrated into shash when I'll be fixing it properly soon.

As I said it's not that big a deal for shash, but the reason I'm
doing it for shash as well as ahash is to maintain a consistent
export format so that ahash can fallback to shash at any time.

I did try to keep the sha256 library interface working so as not to
impede your work on that.

> But whatever, as usual for your submissions this will get pushed out anyway,
> likely without running the tests (FYI the compression tests are already failing
> on cryptodev/master due to your recent changes).

The shash algorithm has gone through all the usual tests.

Thanks for reporting the deflate breakage.  I wasn't expecting that as
the change in question didn't actually touch deflate.

Cheers,

---8<---
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>
diff mbox series

Patch

diff --git a/crypto/acompress.c b/crypto/acompress.c
index b0f9192f6b2e..4c665c6fb5d6 100644
--- a/crypto/acompress.c
+++ b/crypto/acompress.c
@@ -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);