diff options
author | Devendra Naga <develkernel412222@gmail.com> | 2012-08-04 13:12:21 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-12 06:29:24 -0400 |
commit | ada3678c6a9a0c404acf15e98679315b29689b73 (patch) | |
tree | 830f7d54e59a6e531ffd4151c16db0b4571e19bb | |
parent | 4aff355cd51378b6e9ca8c0a3961571ebafd1367 (diff) |
[media] staging: media: cxd2099: use kzalloc to allocate ci pointer of 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>
-rw-r--r-- | drivers/staging/media/cxd2099/cxd2099.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/media/cxd2099/cxd2099.c b/drivers/staging/media/cxd2099/cxd2099.c index 16785032ac8c..4f2235f2153d 100644 --- a/drivers/staging/media/cxd2099/cxd2099.c +++ b/drivers/staging/media/cxd2099/cxd2099.c | |||
@@ -691,10 +691,9 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg, | |||
691 | return NULL; | 691 | return NULL; |
692 | } | 692 | } |
693 | 693 | ||
694 | ci = kmalloc(sizeof(struct cxd), GFP_KERNEL); | 694 | ci = kzalloc(sizeof(struct cxd), GFP_KERNEL); |
695 | if (!ci) | 695 | if (!ci) |
696 | return NULL; | 696 | return NULL; |
697 | memset(ci, 0, sizeof(*ci)); | ||
698 | 697 | ||
699 | mutex_init(&ci->lock); | 698 | mutex_init(&ci->lock); |
700 | memcpy(&ci->cfg, cfg, sizeof(struct cxd2099_cfg)); | 699 | memcpy(&ci->cfg, cfg, sizeof(struct cxd2099_cfg)); |