mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
[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>
This commit is contained in:
parent
26f61c0ddf
commit
73446966b9
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue