aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/deflate.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-11-27 03:30:39 -0500
committerHerbert Xu <herbert@gondor.apana.org.au>2010-11-27 03:30:39 -0500
commitc8484594aeafe889269bd01232049b184140de3f (patch)
treec46365ca7ede307da79f486ba2b49e66a8a861d4 /crypto/deflate.c
parent8ff590903d5fc7f5a0a988c38267a3d08e6393a2 (diff)
crypto: Use vzalloc
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/deflate.c')
-rw-r--r--crypto/deflate.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/crypto/deflate.c b/crypto/deflate.c
index 463dc859aa05..cbc7a33a9600 100644
--- a/crypto/deflate.c
+++ b/crypto/deflate.c
@@ -48,12 +48,11 @@ static int deflate_comp_init(struct deflate_ctx *ctx)
48 int ret = 0; 48 int ret = 0;
49 struct z_stream_s *stream = &ctx->comp_stream; 49 struct z_stream_s *stream = &ctx->comp_stream;
50 50
51 stream->workspace = vmalloc(zlib_deflate_workspacesize()); 51 stream->workspace = vzalloc(zlib_deflate_workspacesize());
52 if (!stream->workspace) { 52 if (!stream->workspace) {
53 ret = -ENOMEM; 53 ret = -ENOMEM;
54 goto out; 54 goto out;
55 } 55 }
56 memset(stream->workspace, 0, zlib_deflate_workspacesize());
57 ret = zlib_deflateInit2(stream, DEFLATE_DEF_LEVEL, Z_DEFLATED, 56 ret = zlib_deflateInit2(stream, DEFLATE_DEF_LEVEL, Z_DEFLATED,
58 -DEFLATE_DEF_WINBITS, DEFLATE_DEF_MEMLEVEL, 57 -DEFLATE_DEF_WINBITS, DEFLATE_DEF_MEMLEVEL,
59 Z_DEFAULT_STRATEGY); 58 Z_DEFAULT_STRATEGY);