[-next] media: vimc: Fix error return code in vimc_register_devices()
diff mbox series

Message ID 20191008090133.9760-1-weiyongjun1@huawei.com
State New
Headers show
Series
  • [-next] media: vimc: Fix error return code in vimc_register_devices()
Related show

Commit Message

Wei Yongjun Oct. 8, 2019, 9:01 a.m. UTC
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>
---
 drivers/media/platform/vimc/vimc-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Helen Koike Oct. 8, 2019, 1:22 p.m. UTC | #1
Hi,

On 10/8/19 6:01 AM, Wei Yongjun wrote:
> 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>

Thank you
Helen

> ---
>  drivers/media/platform/vimc/vimc-core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c
> index 6e3e5c91ae39..2d20a7c10398 100644
> --- a/drivers/media/platform/vimc/vimc-core.c
> +++ b/drivers/media/platform/vimc/vimc-core.c
> @@ -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);
> 
> 
>

Patch
diff mbox series

diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c
index 6e3e5c91ae39..2d20a7c10398 100644
--- a/drivers/media/platform/vimc/vimc-core.c
+++ b/drivers/media/platform/vimc/vimc-core.c
@@ -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);