2021-03-05 09:52:10

by Jia-Ju Bai

[permalink] [raw]
Subject: [PATCH] media: platform: xilinx: fix error return code of xvip_graph_init()

When the list of xdev->notifier.asd_list is empty, no error return code
of xvip_graph_init() is assigned.
To fix this bug, ret is assigned with -ENOENT as error return code.

Reported-by: TOTE Robot <[email protected]>
Signed-off-by: Jia-Ju Bai <[email protected]>
---
drivers/media/platform/xilinx/xilinx-vipp.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c
index bf4015d852e3..2ce31d7ce1a6 100644
--- a/drivers/media/platform/xilinx/xilinx-vipp.c
+++ b/drivers/media/platform/xilinx/xilinx-vipp.c
@@ -525,6 +525,7 @@ static int xvip_graph_init(struct xvip_composite_device *xdev)

if (list_empty(&xdev->notifier.asd_list)) {
dev_err(xdev->dev, "no subdev found in graph\n");
+ ret = -ENOENT;
goto done;
}

--
2.17.1


2021-03-05 10:11:13

by Michal Simek

[permalink] [raw]
Subject: Re: [PATCH] media: platform: xilinx: fix error return code of xvip_graph_init()



On 3/5/21 10:48 AM, Jia-Ju Bai wrote:
> When the list of xdev->notifier.asd_list is empty, no error return code
> of xvip_graph_init() is assigned.
> To fix this bug, ret is assigned with -ENOENT as error return code.
>
> Reported-by: TOTE Robot <[email protected]>
> Signed-off-by: Jia-Ju Bai <[email protected]>
> ---
> drivers/media/platform/xilinx/xilinx-vipp.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c
> index bf4015d852e3..2ce31d7ce1a6 100644
> --- a/drivers/media/platform/xilinx/xilinx-vipp.c
> +++ b/drivers/media/platform/xilinx/xilinx-vipp.c
> @@ -525,6 +525,7 @@ static int xvip_graph_init(struct xvip_composite_device *xdev)
>
> if (list_empty(&xdev->notifier.asd_list)) {
> dev_err(xdev->dev, "no subdev found in graph\n");
> + ret = -ENOENT;
> goto done;
> }
>
>

Reviewed-by: Michal Simek <[email protected]>

Thanks,
Michal