From 163b6cd934a2ec9f255eba346e3330c49f779c31 Mon Sep 17 00:00:00 2001 From: Zhang Jinde Date: Tue, 7 Jan 2020 15:33:49 +0800 Subject: [PATCH] igzip: Fix for deflate logic buffer management Fixes invalid logic that attempted to eliminate unnecessary copy of input to the history buffer in cases where it is not required. Correction should improve performance and not change functionality. Change-Id: Ife24dcc9d920ce220b1a394031e971321737a171 Signed-off-by: Zhang Jinde --- igzip/igzip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/igzip/igzip.c b/igzip/igzip.c index 52a5dc4..44d44d8 100644 --- a/igzip/igzip.c +++ b/igzip/igzip.c @@ -1574,7 +1574,7 @@ int isal_deflate(struct isal_zstream *stream) /* Buffer history if data was pulled from the external buffer and future * calls to deflate will be required */ - if (!internal && (state->state != ZSTATE_END || state->state != ZSTATE_TRL)) { + if (!internal && (state->state != ZSTATE_END && state->state != ZSTATE_TRL)) { /* If the external buffer was used, sufficient history must * exist in the user input buffer */ /* assert(stream->total_in - total_start >= */