Skip to content

Commit

Permalink
media: tvp5150: Fix wrong return value of tvp5150_parse_dt()
Browse files Browse the repository at this point in the history
[ Upstream commit eb08c48 ]

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: 0556f1d ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
z00467499 authored and gregkh committed Dec 30, 2020
1 parent 9c14fb5 commit 1067e24
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/media/i2c/tvp5150.c
Expand Up @@ -2082,6 +2082,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;
}
Expand Down

0 comments on commit 1067e24

Please sign in to comment.