From: Dafna Hirschfeld Date: Mon, 7 Oct 2019 13:49:59 +0000 (-0300) Subject: media: vimc: initialize vim entity pointers to NULL X-Git-Tag: v5.5-rc1~143^2^2~113 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=817d0b3278f52d4d20b9706e41c808287ee909e4;p=users%2Fwilly%2Fxarray.git 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 Acked-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- 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;