Skip to content

Commit 91b3c8d

Browse files
windhlsuperna9999
authored andcommitted
drm/meson: Fix refcount bugs in meson_vpu_has_available_connectors()
In this function, there are two refcount leak bugs: (1) when breaking out of for_each_endpoint_of_node(), we need call the of_node_put() for the 'ep'; (2) we should call of_node_put() for the reference returned by of_graph_get_remote_port() when it is not used anymore. Fixes: bbbe775 ("drm: Add support for Amlogic Meson Graphic Controller") Signed-off-by: Liang He <[email protected]> Acked-by: Martin Blumenstingl <[email protected]> Acked-by: Neil Armstrong <[email protected]> Signed-off-by: Neil Armstrong <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent c20ee57 commit 91b3c8d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/gpu/drm/meson/meson_drv.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,11 @@ static bool meson_vpu_has_available_connectors(struct device *dev)
115115
for_each_endpoint_of_node(dev->of_node, ep) {
116116
/* If the endpoint node exists, consider it enabled */
117117
remote = of_graph_get_remote_port(ep);
118-
if (remote)
118+
if (remote) {
119+
of_node_put(remote);
120+
of_node_put(ep);
119121
return true;
122+
}
120123
}
121124

122125
return false;

0 commit comments

Comments
 (0)