Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-2.6.git] / crypto / deflate.c
index 463dc85..b5ccae2 100644 (file)
@@ -48,12 +48,12 @@ static int deflate_comp_init(struct deflate_ctx *ctx)
        int ret = 0;
        struct z_stream_s *stream = &ctx->comp_stream;
 
-       stream->workspace = vmalloc(zlib_deflate_workspacesize());
+       stream->workspace = vzalloc(zlib_deflate_workspacesize(
+                               -DEFLATE_DEF_WINBITS, DEFLATE_DEF_MEMLEVEL));
        if (!stream->workspace) {
                ret = -ENOMEM;
                goto out;
        }
-       memset(stream->workspace, 0, zlib_deflate_workspacesize());
        ret = zlib_deflateInit2(stream, DEFLATE_DEF_LEVEL, Z_DEFLATED,
                                -DEFLATE_DEF_WINBITS, DEFLATE_DEF_MEMLEVEL,
                                Z_DEFAULT_STRATEGY);