summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2016-10-09 22:12:13 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-11-16 17:18:18 +0300
commit73446966b9ab9da118bb905bdbb5e8d3a1826b25 (patch)
tree06dbb1059720f461e19f8975215dbcacf397a94a
parent26f61c0ddf0e191fdab5c15f00c4bf8f3544be6b (diff)
downloadlinux-73446966b9ab9da118bb905bdbb5e8d3a1826b25.tar.xz
[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 <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/platform/blackfin/bfin_capture.c2
1 files changed, 1 insertions, 1 deletions
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;