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 <dan.carpenter@xxxxxxxxxx> Closes: https://lore.kernel.org/linux-crypto/92929e50-5650-40be-8c0a-de81e77f0acf@sabinyo.mountain/ Signed-off-by: Suman Kumar Chakraborty <suman.kumar.chakraborty@xxxxxxxxx> Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@xxxxxxxxx> --- crypto/zstd.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crypto/zstd.c b/crypto/zstd.c index 657e0cf7b952..24edb4d616b5 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: base-commit: 864453d2e854790ec8bfe7e05f84ecdb0167026d -- 2.40.1