Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/omap: dss: Fix refcount leak bugs

In dss_init_ports() and __dss_uninit_ports(), we should call
of_node_put() for the reference returned by of_graph_get_port_by_id()
in fail path or when it is not used anymore.

Fixes: 09bffa6e5192 ("drm: omap: use common OF graph helpers")
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220722144348.1306569-1-windhl@126.com

authored by

Liang He and committed by
Tomi Valkeinen
8b42057e e8523f53

+3
+3
drivers/gpu/drm/omapdrm/dss/dss.c
··· 1176 1176 default: 1177 1177 break; 1178 1178 } 1179 + of_node_put(port); 1179 1180 } 1180 1181 } 1181 1182 ··· 1209 1208 default: 1210 1209 break; 1211 1210 } 1211 + of_node_put(port); 1212 1212 } 1213 1213 1214 1214 return 0; 1215 1215 1216 1216 error: 1217 + of_node_put(port); 1217 1218 __dss_uninit_ports(dss, i); 1218 1219 return r; 1219 1220 }