since NULL value for vimc entity pointer indicates
that entity creation failed and this is tested, the
pointers should be initialized to NULL.
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
}
/* allocate ent_devs */
- vimc->ent_devs = kmalloc_array(vimc->pipe_cfg->num_ents,
- sizeof(*vimc->ent_devs),
- GFP_KERNEL);
+ vimc->ent_devs = kcalloc(vimc->pipe_cfg->num_ents,
+ sizeof(*vimc->ent_devs), GFP_KERNEL);
if (!vimc->ent_devs) {
ret = -ENOMEM;
goto err_v4l2_unregister;