[4/8] lib/zlib: Fix DFLTCC ignoring flush modes when avail_in == 0

Message ID 20230126131428.1222214-5-zaslonko@linux.ibm.com
State New
Headers
Series lib/zlib: Set of s390 DFLTCC related patches for kernel zlib |

Commit Message

Zaslonko Mikhail Jan. 26, 2023, 1:14 p.m. UTC
  This commit is based on:
  https://github.com/zlib-ng/zlib-ng/commit/40acb3f

Signed-off-by: Mikhail Zaslonko <zaslonko@linux.ibm.com>
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
---
 lib/zlib_dfltcc/dfltcc_deflate.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Patch

diff --git a/lib/zlib_dfltcc/dfltcc_deflate.c b/lib/zlib_dfltcc/dfltcc_deflate.c
index dc85ec890163..211d344710d5 100644
--- a/lib/zlib_dfltcc/dfltcc_deflate.c
+++ b/lib/zlib_dfltcc/dfltcc_deflate.c
@@ -142,7 +142,8 @@  int dfltcc_deflate(
         /* 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;
     }