summaryrefslogtreecommitdiffstats
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorAlexey Khoroshilov2018-05-25 23:54:00 +0200
committerMauro Carvalho Chehab2018-06-28 12:38:43 +0200
commit64bac6916ef7d9cc57367893aea1544fcad91b9b (patch)
treeb08bf0a1bbd160b47c91a22ed8918d48a0d4245a /drivers/media/i2c
parentmedia: cx231xx: fix RC_CORE dependency (diff)
downloadkernel-qcow2-linux-64bac6916ef7d9cc57367893aea1544fcad91b9b.tar.gz
kernel-qcow2-linux-64bac6916ef7d9cc57367893aea1544fcad91b9b.tar.xz
kernel-qcow2-linux-64bac6916ef7d9cc57367893aea1544fcad91b9b.zip
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: Alexey Khoroshilov <khoroshilov@ispras.ru> Reviewed-by: Nicholas Mc Guire <der.herr@hofr.at> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/tc358743.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index 393bbbbbaad7..44c41933415a 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -1918,7 +1918,8 @@ static int tc358743_probe_of(struct tc358743_state *state)
endpoint = v4l2_fwnode_endpoint_alloc_parse(of_fwnode_handle(ep));
if (IS_ERR(endpoint)) {
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 ||
@@ -2013,6 +2014,8 @@ disable_clk:
clk_disable_unprepare(refclk);
free_endpoint:
v4l2_fwnode_endpoint_free(endpoint);
+put_node:
+ of_node_put(ep);
return ret;
}
#else