aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>2019-10-07 10:49:59 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-10-24 18:59:52 -0300
commit817d0b3278f52d4d20b9706e41c808287ee909e4 (patch)
tree86849a42426511ac4d55d70f4d01d225a00fbb8c /drivers/media/platform
parentmedia: imon: invalid dereference in imon_touch_event (diff)
downloadlinux-dev-817d0b3278f52d4d20b9706e41c808287ee909e4.tar.xz
linux-dev-817d0b3278f52d4d20b9706e41c808287ee909e4.zip
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: 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>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/vimc/vimc-core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c
index 2d20a7c10398..65048bd7d80b 100644
--- a/drivers/media/platform/vimc/vimc-core.c
+++ b/drivers/media/platform/vimc/vimc-core.c
@@ -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;