From: Mikhail Zaslonko Date: Thu, 26 Jan 2023 13:14:24 +0000 (+0100) Subject: lib/zlib: fix DFLTCC ignoring flush modes when avail_in == 0 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0dbae46550363c88cf073aafc0e0b244b9f43555;p=users%2Fjedix%2Flinux-maple.git lib/zlib: fix DFLTCC ignoring flush modes when avail_in == 0 This commit is based on: https://github.com/zlib-ng/zlib-ng/commit/40acb3f Link: https://lkml.kernel.org/r/20230126131428.1222214-5-zaslonko@linux.ibm.com Signed-off-by: Mikhail Zaslonko Acked-by: Ilya Leoshkevich Cc: Heiko Carstens Cc: Vasily Gorbik Signed-off-by: Andrew Morton --- diff --git a/lib/zlib_dfltcc/dfltcc_deflate.c b/lib/zlib_dfltcc/dfltcc_deflate.c index dc85ec8901636..211d344710d5d 100644 --- a/lib/zlib_dfltcc/dfltcc_deflate.c +++ b/lib/zlib_dfltcc/dfltcc_deflate.c @@ -142,7 +142,8 @@ again: /* Clear history. */ if (flush == Z_FULL_FLUSH) param->hl = 0; - *result = need_more; + /* Trigger block post-processing if necessary. */ + *result = no_flush ? need_more : block_done; return 1; }