From: Suman Kumar Chakraborty Date: Mon, 30 Jun 2025 09:24:18 +0000 (+0100) Subject: crypto: zstd - fix duplicate check warning X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03ba056e63d3b2d3774c7a8cf40f5a31b968b612;p=thirdparty%2Flinux.git crypto: zstd - fix duplicate check warning Fix the following warnings reported by the static analyzer Smatch: crypto/zstd.c:273 zstd_decompress() warn: duplicate check 'scur' (previous on line 235) Fixes: f5ad93ffb541 ("crypto: zstd - convert to acomp") Reported-by: Dan Carpenter Closes: https://lore.kernel.org/linux-crypto/92929e50-5650-40be-8c0a-de81e77f0acf@sabinyo.mountain/ Signed-off-by: Suman Kumar Chakraborty Reviewed-by: Giovanni Cabiddu Signed-off-by: Herbert Xu --- diff --git a/crypto/zstd.c b/crypto/zstd.c index 657e0cf7b9524..24edb4d616b56 100644 --- a/crypto/zstd.c +++ b/crypto/zstd.c @@ -268,10 +268,9 @@ static int zstd_decompress(struct acomp_req *req) total_out += outbuf.pos; acomp_walk_done_dst(&walk, outbuf.pos); - } while (scur != inbuf.pos); + } while (inbuf.pos != scur); - if (scur) - acomp_walk_done_src(&walk, scur); + acomp_walk_done_src(&walk, scur); } while (ret == 0); out: