提交 817d0b32 编写于 作者: D Dafna Hirschfeld 提交者: Mauro Carvalho Chehab

media: vimc: initialize vim entity pointers to NULL

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: NDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Acked-by: NHelen Koike <helen.koike@collabora.com>
Signed-off-by: NHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab+samsung@kernel.org>
上级 f3f5ba42
......@@ -199,9 +199,8 @@ static int vimc_register_devices(struct vimc_device *vimc)
}
/* 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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册