aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulia Lawall <[email protected]>2021-07-09 22:07:17 +0200
committerDaniel Vetter <[email protected]>2021-07-12 16:25:53 +0200
commitb557a5f8da5798d27370ed6b73e673aae33efd55 (patch)
tree6beedc6b7bb19cceb30898a164280428f1ba6111
parent7dc924d7c595b21c084644be6d18014aae505b0f (diff)
drm/of: free the right object
There is no need to free a NULL value. Instead, free the object that is leaking due to the iterator. The semantic patch that finds this problem is as follows: // <smpl> @@ expression x,e; identifier f; @@ x = f(...); if (x == NULL) { ... when any when != x = e * of_node_put(x); ... } // </smpl> Fixes: 6529007522de ("drm: of: Add drm_of_lvds_get_dual_link_pixel_order") Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r--drivers/gpu/drm/drm_of.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_of.c b/drivers/gpu/drm/drm_of.c
index ca04c34e8251..197c57477344 100644
--- a/drivers/gpu/drm/drm_of.c
+++ b/drivers/gpu/drm/drm_of.c
@@ -315,7 +315,7 @@ static int drm_of_lvds_get_remote_pixels_type(
remote_port = of_graph_get_remote_port(endpoint);
if (!remote_port) {
- of_node_put(remote_port);
+ of_node_put(endpoint);
return -EPIPE;
}