drm/meson: Fix refcount bugs in meson_vpu_has_available_connectors()
PATCH 1/1 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.
--- drivers/gpu/drm/meson/meson_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/meson/meson_drv.c +4 -1
@@ -115,8 +115,11 @@ static bool meson_vpu_has_available_connectors(struct device *dev)for_each_endpoint_of_node (dev->of_node, ep) {/* If the endpoint node exists, consider it enabled */ remote =of_graph_get_remote_port (ep); -if (remote) +if (remote) { +of_node_put (remote); +of_node_put (ep);return true; + } }return false;
Signature · 1 line
2.25.1
Hello,
Quoted 9 lines · Liang He
In this function, there are two refcount leak bugs:
(1) when breaking out offor_each_endpoint_of_node(), we need call theof_node_put()for the 'ep';
(2) we should callof_node_put()for the reference returned byof_graph_get_remote_port()when it is not used anymore.Fixes bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller")Signed-off-by Liang He <[email protected]>
It's easy for me to miss patches if the linux-amlogic list is not part of the recipient list.
Can you please re-send this patch and include the linux-amlogic mailing list (with my acked-by added)? Then it should also show up in Neil's inbox so he can apply this patch.
Thank you
Martin
Quoted 21 lines · Martin Blumenstingl
Hello,
Quoted 9 lines · Liang He
In this function, there are two refcount leak bugs:
(1) when breaking out offor_each_endpoint_of_node(), we need call theof_node_put()for the 'ep';
(2) we should callof_node_put()for the reference returned byof_graph_get_remote_port()when it is not used anymore.Fixes bbbe775ec5b5 ("drm: Add support for Amlogic Meson Graphic Controller")Signed-off-by Liang He <[email protected]>It's easy for me to miss patches if the linux-amlogic list is not part of the recipient list.
Can you please re-send this patch and include the linux-amlogic mailing list (with my acked-by added)? Then it should also show up in Neil's inbox so he can apply this patch.
Quoted 2 lines
Thank you
Martin
Thanks,
I will do that soon.