[CRYPTO] all: Use kzalloc where possible
authorEric Sesterhenn <snakebyte@gmx.de>
Mon, 6 Mar 2006 10:42:07 +0000 (21:42 +1100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 21 Mar 2006 09:14:08 +0000 (20:14 +1100)
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>
crypto/api.c
crypto/deflate.c

index 34e02caffc2a3307db3cfe99a47dd24e846e4724..80bba637fba7c1d325e0718bcfa800659f46251e 100644 (file)
@@ -179,12 +179,10 @@ struct crypto_tfm *crypto_alloc_tfm(const char *name, u32 flags)
                goto out;
 
        tfm_size = sizeof(*tfm) + crypto_ctxsize(alg, flags);
-       tfm = kmalloc(tfm_size, GFP_KERNEL);
+       tfm = kzalloc(tfm_size, GFP_KERNEL);
        if (tfm == NULL)
                goto out_put;
 
-       memset(tfm, 0, tfm_size);
-       
        tfm->__crt_alg = alg;
        
        if (crypto_init_flags(tfm, flags))
index bc73342cd1ecc253909440de480909b7eab10beb..f209368d62aefab5c1c1998f2af20159d5323d6b 100644 (file)
@@ -73,12 +73,11 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
        int ret = 0;
        struct z_stream_s *stream = &ctx->decomp_stream;
 
-       stream->workspace = kmalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
+       stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
        if (!stream->workspace ) {
                ret = -ENOMEM;
                goto out;
        }
-       memset(stream->workspace, 0, zlib_inflate_workspacesize());
        ret = zlib_inflateInit2(stream, -DEFLATE_DEF_WINBITS);
        if (ret != Z_OK) {
                ret = -EINVAL;