]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
media: vimc: Fix error return code in vimc_register_devices()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 8 Oct 2019 09:01:33 +0000 (06:01 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 10 Oct 2019 10:22:54 +0000 (07:22 -0300)
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: f13d5f361959 ("media: vimc: Collapse component structure into a single monolithic driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.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>
drivers/media/platform/vimc/vimc-core.c

index 6e3e5c91ae390751006fa884d5eaee8d49ad2fbc..2d20a7c103986d437f2f968743b89c44151f2195 100644 (file)
@@ -202,8 +202,10 @@ static int vimc_register_devices(struct vimc_device *vimc)
        vimc->ent_devs = kmalloc_array(vimc->pipe_cfg->num_ents,
                                       sizeof(*vimc->ent_devs),
                                       GFP_KERNEL);
-       if (!vimc->ent_devs)
+       if (!vimc->ent_devs) {
+               ret = -ENOMEM;
                goto err_v4l2_unregister;
+       }
 
        /* Invoke entity config hooks to initialize and register subdevs */
        ret = vimc_add_subdevs(vimc);