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 <zjd5536@163.com>
This commit is contained in:
Zhang Jinde 2020-01-07 15:33:49 +08:00 committed by Greg Tucker
parent fc69e8fc79
commit 163b6cd934

View File

@ -1574,7 +1574,7 @@ int isal_deflate(struct isal_zstream *stream)
/* Buffer history if data was pulled from the external buffer and future /* Buffer history if data was pulled from the external buffer and future
* calls to deflate will be required */ * 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 /* If the external buffer was used, sufficient history must
* exist in the user input buffer */ * exist in the user input buffer */
/* assert(stream->total_in - total_start >= */ /* assert(stream->total_in - total_start >= */