提交 ada3678c 编写于 作者: D Devendra Naga 提交者: Mauro Carvalho Chehab

[media] staging: media: cxd2099: use kzalloc to allocate ci pointer of type...

[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: NDevendra Naga <develkernel412222@gmail.com>
Cc: Ralph Metzler <rjkm@metzlerbros.de>
Cc: Oliver Endriss <o.endriss@gmx.de>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 4aff355c
...@@ -691,10 +691,9 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg, ...@@ -691,10 +691,9 @@ struct dvb_ca_en50221 *cxd2099_attach(struct cxd2099_cfg *cfg,
return NULL; return NULL;
} }
ci = kmalloc(sizeof(struct cxd), GFP_KERNEL); ci = kzalloc(sizeof(struct cxd), GFP_KERNEL);
if (!ci) if (!ci)
return NULL; return NULL;
memset(ci, 0, sizeof(*ci));
mutex_init(&ci->lock); mutex_init(&ci->lock);
memcpy(&ci->cfg, cfg, sizeof(struct cxd2099_cfg)); memcpy(&ci->cfg, cfg, sizeof(struct cxd2099_cfg));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册