From: Artem B. Bityuckiy Date: Sat, 16 Apr 2005 22:23:58 +0000 (-0700) Subject: [PATCH] crypto: call zlib end functions on deflate exit path X-Git-Tag: v2.6.12-rc3~238 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=9ffb7146f0aa9c0070cda3d8701b0a89e34913d1;p=~emulex%2Finfiniband.git [PATCH] crypto: call zlib end functions on deflate exit path In the deflate_[compress|uncompress|pcompress] functions we call the zlib_[in|de]flateReset function at the beginning. This is OK. But when we unload the deflate module we don't call zlib_[in|de]flateEnd to free all the zlib internal data. It looks like a bug for me. Please, consider the attached patch. Signed-off-by: Artem B. Bityuckiy Signed-off-by: Herbert Xu Cc: "David S. Miller" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/crypto/deflate.c b/crypto/deflate.c index 77d7655d316..bc73342cd1e 100644 --- a/crypto/deflate.c +++ b/crypto/deflate.c @@ -93,11 +93,13 @@ out_free: static void deflate_comp_exit(struct deflate_ctx *ctx) { + zlib_deflateEnd(&ctx->comp_stream); vfree(ctx->comp_stream.workspace); } static void deflate_decomp_exit(struct deflate_ctx *ctx) { + zlib_inflateEnd(&ctx->decomp_stream); kfree(ctx->decomp_stream.workspace); }