Commit 0b1e1eb7 authored by Boris Brezillon's avatar Boris Brezillon

drm: atmel-hlcdc: Fix OF graph parsing

atmel_hlcdc_create_outputs() iterates over OF graph nodes and releases
the node (using of_node_put()) after each iteration, which is wrong
since for_each_endpoint_of_node() is already taking care of that.

Move the of_node_put() call in the error path.
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
Reviewed-by: default avatarNicolas Ferre <nicolas.ferre@atmel.com>
Fixes: 17a8e03e ("drm: atmel-hlcdc: rework the output code to support drm bridges")
parent 1b7e38b9
...@@ -266,20 +266,22 @@ int atmel_hlcdc_create_outputs(struct drm_device *dev) ...@@ -266,20 +266,22 @@ int atmel_hlcdc_create_outputs(struct drm_device *dev)
if (!ret) if (!ret)
ret = atmel_hlcdc_check_endpoint(dev, &ep); ret = atmel_hlcdc_check_endpoint(dev, &ep);
if (ret) {
of_node_put(ep_np); of_node_put(ep_np);
if (ret)
return ret; return ret;
} }
}
for_each_endpoint_of_node(dev->dev->of_node, ep_np) { for_each_endpoint_of_node(dev->dev->of_node, ep_np) {
ret = of_graph_parse_endpoint(ep_np, &ep); ret = of_graph_parse_endpoint(ep_np, &ep);
if (!ret) if (!ret)
ret = atmel_hlcdc_attach_endpoint(dev, &ep); ret = atmel_hlcdc_attach_endpoint(dev, &ep);
if (ret) {
of_node_put(ep_np); of_node_put(ep_np);
if (ret)
return ret; return ret;
} }
}
return 0; return 0;
} }
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