drm/bridge: tc358767: Add of_node_put() when breaking out of loop

In tc_probe_bridge_endpoint(), we should call of_node_put() when
breaking out of the for_each_endpoint_of_node() which will automatically
increase and decrease the refcount.

Fixes: 71f7d9c031 ("drm/bridge: tc358767: Detect bridge mode from connected endpoints in DT")
Signed-off-by: Liang He <windhl@126.com>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
Signed-off-by: Robert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220719065447.1080817-2-windhl@126.com
This commit is contained in:
Liang He 2022-07-19 14:54:47 +08:00 committed by Robert Foss
parent 1d43a5120a
commit 14e7157afb
No known key found for this signature in database
GPG Key ID: 3EFD900F76D1D784
1 changed files with 3 additions and 2 deletions

View File

@ -2010,9 +2010,10 @@ static int tc_probe_bridge_endpoint(struct tc_data *tc)
for_each_endpoint_of_node(dev->of_node, node) {
of_graph_parse_endpoint(node, &endpoint);
if (endpoint.port > 2)
if (endpoint.port > 2) {
of_node_put(node);
return -EINVAL;
}
mode |= BIT(endpoint.port);
}