media: tvp5150: Fix wrong return value of tvp5150_parse_dt()
authorZhang Xiaoxu <zhangxiaoxu5@huawei.com>
Mon, 16 Nov 2020 14:18:01 +0000 (15:18 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 3 Dec 2020 06:37:33 +0000 (07:37 +0100)
If of_graph_get_endpoint_by_regs() return NULL, it will return 0 rather
than an errno, because we doesn't initialize the return value.

Fixes: 0556f1d580d4 ("media: tvp5150: add input source selection of_graph support")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/tvp5150.c

index 29f65bb..e26e3f5 100644 (file)
@@ -2080,6 +2080,7 @@ static int tvp5150_parse_dt(struct tvp5150 *decoder, struct device_node *np)
 
        ep_np = of_graph_get_endpoint_by_regs(np, TVP5150_PAD_VID_OUT, 0);
        if (!ep_np) {
+               ret = -EINVAL;
                dev_err(dev, "Error no output endpoint available\n");
                goto err_free;
        }