Commit b557a5f8 authored by Julia Lawall's avatar Julia Lawall Committed by Daniel Vetter

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: 65290075 ("drm: of: Add drm_of_lvds_get_dual_link_pixel_order")
Signed-off-by: default avatarJulia Lawall <Julia.Lawall@inria.fr>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210709200717.3676376-1-Julia.Lawall@inria.fr
parent 7dc924d7
......@@ -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;
}
......
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