diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2023-02-13 11:10:05 +0800 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2023-03-10 19:10:09 +0800 |
commit | 4c9edf17c0b44655c565b59a956161a2ee125cca (patch) | |
tree | c0b815de500f17f9efd655c384681ef4298cff4d /include/crypto | |
parent | fe15c26ee26efa11741a7b632e9f23b01aca4cc6 (diff) |
crypto: acomp - Be more careful with request flags
The request flags for acompress is split into two parts. Part of
it may be set by the user while the other part (ALLOC_OUTPUT) is
managed by the API.
This patch makes the split more explicit by not touching the other
bits at all in the two "set" functions that let the user modify the
flags.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/acompress.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/crypto/acompress.h b/include/crypto/acompress.h index e4bc96528902..c14cfc9a3b79 100644 --- a/include/crypto/acompress.h +++ b/include/crypto/acompress.h @@ -219,7 +219,8 @@ static inline void acomp_request_set_callback(struct acomp_req *req, { req->base.complete = cmpl; req->base.data = data; - req->base.flags = flgs; + req->base.flags &= CRYPTO_ACOMP_ALLOC_OUTPUT; + req->base.flags |= flgs & ~CRYPTO_ACOMP_ALLOC_OUTPUT; } /** @@ -246,6 +247,7 @@ static inline void acomp_request_set_params(struct acomp_req *req, req->slen = slen; req->dlen = dlen; + req->flags &= ~CRYPTO_ACOMP_ALLOC_OUTPUT; if (!req->dst) req->flags |= CRYPTO_ACOMP_ALLOC_OUTPUT; } |