diff options
| author | Herbert Xu <herbert@gondor.apana.org.au> | 2025-09-30 16:08:34 +0800 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2025-10-02 15:02:44 +0800 |
| commit | 81c1a15eb4a273eabedfcc28eb6afa4b50cb8a46 (patch) | |
| tree | b7a91209d6e8d5dad0f3119edeac3b87a5b2899d /crypto/zstd.c | |
| parent | 166c83f7789ed02dc1f25bc7bed4a1beb25343aa (diff) | |
| download | bpf-next-81c1a15eb4a273eabedfcc28eb6afa4b50cb8a46.tar.gz | |
crypto: zstd - Fix compression bug caused by truncation
Use size_t for the return value of zstd_compress_cctx as otherwise
negative errors will be truncated to a positive value.
Reported-by: Han Xu <han.xu@nxp.com>
Fixes: f5ad93ffb541 ("crypto: zstd - convert to acomp")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Reviewed-by: David Sterba <dsterba@suse.com>
Tested-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/zstd.c')
| -rw-r--r-- | crypto/zstd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/zstd.c b/crypto/zstd.c index c2a19cb0879d60..ac318d333b6847 100644 --- a/crypto/zstd.c +++ b/crypto/zstd.c @@ -83,7 +83,7 @@ static void zstd_exit(struct crypto_acomp *acomp_tfm) static int zstd_compress_one(struct acomp_req *req, struct zstd_ctx *ctx, const void *src, void *dst, unsigned int *dlen) { - unsigned int out_len; + size_t out_len; ctx->cctx = zstd_init_cctx(ctx->wksp, ctx->wksp_size); if (!ctx->cctx) |
