Skip to content

Commit f1ebbe4

Browse files
elfringhdeller
authored andcommitted
fbdev: omapfb: Call of_node_put(ep) only once in omapdss_of_find_source_for_first_ep()
An of_node_put(ep) call was immediately used after a pointer check for a of_graph_get_remote_port() call in this function implementation. Thus call such a function only once instead directly before the check. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent 5b97eeb commit f1ebbe4

File tree

1 file changed

+2
-5
lines changed
  • drivers/video/fbdev/omap2/omapfb/dss

1 file changed

+2
-5
lines changed

drivers/video/fbdev/omap2/omapfb/dss/dss-of.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,9 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)
129129
return ERR_PTR(-EINVAL);
130130

131131
src_port = of_graph_get_remote_port(ep);
132-
if (!src_port) {
133-
of_node_put(ep);
134-
return ERR_PTR(-EINVAL);
135-
}
136-
137132
of_node_put(ep);
133+
if (!src_port)
134+
return ERR_PTR(-EINVAL);
138135

139136
src = omap_dss_find_output_by_port_node(src_port);
140137

0 commit comments

Comments
 (0)