Skip to content

Commit

Permalink
[PATCH] crypto: call zlib end functions on deflate exit path
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Cc: "David S. Miller" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
dedekind authored and Linus Torvalds committed Apr 16, 2005
1 parent d42ce81 commit 9ffb714
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crypto/deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)

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);
}

Expand Down

0 comments on commit 9ffb714

Please sign in to comment.