diff options
author | Eric Sesterhenn <snakebyte@gmx.de> | 2006-03-06 05:42:07 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2006-03-21 04:14:08 -0500 |
commit | bbeb563f7bb5e703e4d60c18bed81c987781343f (patch) | |
tree | 681d7b0b923e71e7ad38c7b41a6de2b72cce3f21 /crypto | |
parent | f10b7897ee29649fa7f0ccdc8d859ccd6ce7dbfd (diff) |
[CRYPTO] all: Use kzalloc where possible
this patch converts crypto/ to kzalloc usage.
Compile tested with allyesconfig.
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/api.c | 4 | ||||
-rw-r--r-- | crypto/deflate.c | 3 |
2 files changed, 2 insertions, 5 deletions
diff --git a/crypto/api.c b/crypto/api.c index 34e02caffc2a..80bba637fba7 100644 --- a/crypto/api.c +++ b/crypto/api.c | |||
@@ -179,12 +179,10 @@ struct crypto_tfm *crypto_alloc_tfm(const char *name, u32 flags) | |||
179 | goto out; | 179 | goto out; |
180 | 180 | ||
181 | tfm_size = sizeof(*tfm) + crypto_ctxsize(alg, flags); | 181 | tfm_size = sizeof(*tfm) + crypto_ctxsize(alg, flags); |
182 | tfm = kmalloc(tfm_size, GFP_KERNEL); | 182 | tfm = kzalloc(tfm_size, GFP_KERNEL); |
183 | if (tfm == NULL) | 183 | if (tfm == NULL) |
184 | goto out_put; | 184 | goto out_put; |
185 | 185 | ||
186 | memset(tfm, 0, tfm_size); | ||
187 | |||
188 | tfm->__crt_alg = alg; | 186 | tfm->__crt_alg = alg; |
189 | 187 | ||
190 | if (crypto_init_flags(tfm, flags)) | 188 | if (crypto_init_flags(tfm, flags)) |
diff --git a/crypto/deflate.c b/crypto/deflate.c index bc73342cd1ec..f209368d62ae 100644 --- a/crypto/deflate.c +++ b/crypto/deflate.c | |||
@@ -73,12 +73,11 @@ static int deflate_decomp_init(struct deflate_ctx *ctx) | |||
73 | int ret = 0; | 73 | int ret = 0; |
74 | struct z_stream_s *stream = &ctx->decomp_stream; | 74 | struct z_stream_s *stream = &ctx->decomp_stream; |
75 | 75 | ||
76 | stream->workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL); | 76 | stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL); |
77 | if (!stream->workspace ) { | 77 | if (!stream->workspace ) { |
78 | ret = -ENOMEM; | 78 | ret = -ENOMEM; |
79 | goto out; | 79 | goto out; |
80 | } | 80 | } |
81 | memset(stream->workspace, 0, zlib_inflate_workspacesize()); | ||
82 | ret = zlib_inflateInit2(stream, -DEFLATE_DEF_WINBITS); | 81 | ret = zlib_inflateInit2(stream, -DEFLATE_DEF_WINBITS); |
83 | if (ret != Z_OK) { | 82 | if (ret != Z_OK) { |
84 | ret = -EINVAL; | 83 | ret = -EINVAL; |