diff mbox series

crypto: deflate - Remove useless call "zlib_inflateEnd"

Message ID 1617161697-121478-1-git-send-email-jiapeng.chong@linux.alibaba.com (mailing list archive)
State Rejected
Delegated to: Herbert Xu
Headers show
Series crypto: deflate - Remove useless call "zlib_inflateEnd" | expand

Commit Message

Jiapeng Chong March 31, 2021, 3:34 a.m. UTC
Fix the following whitescan warning:

Calling "zlib_inflateEnd(&ctx->decomp_stream)" is only useful for its
return value, which is ignored.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
---
 crypto/deflate.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Herbert Xu April 9, 2021, 7:19 a.m. UTC | #1
On Wed, Mar 31, 2021 at 11:34:57AM +0800, Jiapeng Chong wrote:
> Fix the following whitescan warning:
> 
> Calling "zlib_inflateEnd(&ctx->decomp_stream)" is only useful for its
> return value, which is ignored.
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
> ---
>  crypto/deflate.c | 1 -
>  1 file changed, 1 deletion(-)

The function might not do anything today but the documentation
clearly indicates that it could free any dynamically allocated
data so it should stay.

Cheers,
diff mbox series

Patch

diff --git a/crypto/deflate.c b/crypto/deflate.c
index b2a46f6..cac1672 100644
--- a/crypto/deflate.c
+++ b/crypto/deflate.c
@@ -101,7 +101,6 @@  static void deflate_comp_exit(struct deflate_ctx *ctx)
 
 static void deflate_decomp_exit(struct deflate_ctx *ctx)
 {
-	zlib_inflateEnd(&ctx->decomp_stream);
 	vfree(ctx->decomp_stream.workspace);
 }