From: Markus Elfring Date: Sun, 9 Oct 2016 19:12:13 +0000 (-0300) Subject: [media] blackfin-capture: Use kcalloc() in bcap_init_sensor_formats() X-Git-Tag: microblaze-4.13-rc1~431^2~564 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=73446966b9ab9da118bb905bdbb5e8d3a1826b25;p=linux-2.6-microblaze.git [media] blackfin-capture: Use kcalloc() in bcap_init_sensor_formats() A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus reuse the corresponding function "kcalloc". This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/blackfin/bfin_capture.c b/drivers/media/platform/blackfin/bfin_capture.c index 8eb03397d736..c5e10439e8b9 100644 --- a/drivers/media/platform/blackfin/bfin_capture.c +++ b/drivers/media/platform/blackfin/bfin_capture.c @@ -169,7 +169,7 @@ static int bcap_init_sensor_formats(struct bcap_device *bcap_dev) if (!num_formats) return -ENXIO; - sf = kzalloc(num_formats * sizeof(*sf), GFP_KERNEL); + sf = kcalloc(num_formats, sizeof(*sf), GFP_KERNEL); if (!sf) return -ENOMEM;