Skip to content

Commit

Permalink
[media] staging: media: cxd2099: use kzalloc to allocate ci pointer o…
Browse files Browse the repository at this point in the history
…f type struct cxd in cxd2099_attach

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>
  • Loading branch information
Devendra Naga authored and Mauro Carvalho Chehab committed Aug 12, 2012
1 parent 4aff355 commit ada3678
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/staging/media/cxd2099/cxd2099.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit ada3678

Please sign in to comment.