From: Devendra Naga Date: Sat, 4 Aug 2012 17:12:21 +0000 (-0300) Subject: [media] staging: media: cxd2099: use kzalloc to allocate ci pointer of type struct... X-Git-Tag: firefly_0821_release~3680^2~275^2~1501 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ada3678c6a9a0c404acf15e98679315b29689b73;p=firefly-linux-kernel-4.4.55.git [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 Cc: Ralph Metzler Cc: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- 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, 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));