Commit 64bac691 authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Mauro Carvalho Chehab

media: tc358743: release device_node in tc358743_probe_of()

of_graph_get_next_endpoint() returns device_node with refcnt increased,
but these is no of_node_put() for it.

The patch adds one on error and normal paths.

Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Reviewed-by: default avatarNicholas Mc Guire <der.herr@hofr.at>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 9fab166a
...@@ -1918,7 +1918,8 @@ static int tc358743_probe_of(struct tc358743_state *state) ...@@ -1918,7 +1918,8 @@ static int tc358743_probe_of(struct tc358743_state *state)
endpoint = v4l2_fwnode_endpoint_alloc_parse(of_fwnode_handle(ep)); endpoint = v4l2_fwnode_endpoint_alloc_parse(of_fwnode_handle(ep));
if (IS_ERR(endpoint)) { if (IS_ERR(endpoint)) {
dev_err(dev, "failed to parse endpoint\n"); dev_err(dev, "failed to parse endpoint\n");
return PTR_ERR(endpoint); ret = PTR_ERR(endpoint);
goto put_node;
} }
if (endpoint->bus_type != V4L2_MBUS_CSI2 || if (endpoint->bus_type != V4L2_MBUS_CSI2 ||
...@@ -2013,6 +2014,8 @@ static int tc358743_probe_of(struct tc358743_state *state) ...@@ -2013,6 +2014,8 @@ static int tc358743_probe_of(struct tc358743_state *state)
clk_disable_unprepare(refclk); clk_disable_unprepare(refclk);
free_endpoint: free_endpoint:
v4l2_fwnode_endpoint_free(endpoint); v4l2_fwnode_endpoint_free(endpoint);
put_node:
of_node_put(ep);
return ret; return ret;
} }
#else #else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment