]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
[media] staging: media: cxd2099: use kzalloc to allocate ci pointer of type struct...
authorDevendra Naga <develkernel412222@gmail.com>
Sat, 4 Aug 2012 17:12:21 +0000 (14:12 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 12 Aug 2012 10:29:24 +0000 (07:29 -0300)
this does kmalloc and followed by memset, calling kzalloc will actually
sets the allocated memory to zero, use kzalloc instead

Signed-off-by: Devendra Naga <develkernel412222@gmail.com>
Cc: Ralph Metzler <rjkm@metzlerbros.de>
Cc: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/staging/media/cxd2099/cxd2099.c

index 16785032ac8cc0baa9d5a2abd7fb9b32afea1510..4f2235f2153d6f37cddc0401cc8ec4e62aa75570 100644 (file)
@@ -691,10 +691,9 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg,
                return NULL;
        }
 
-       ci = kmalloc(sizeof(struct cxd), GFP_KERNEL);
+       ci = kzalloc(sizeof(struct cxd), GFP_KERNEL);
        if (!ci)
                return NULL;
-       memset(ci, 0, sizeof(*ci));
 
        mutex_init(&ci->lock);
        memcpy(&ci->cfg, cfg, sizeof(struct cxd2099_cfg));