summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorLiang He <windhl@126.com>2022-07-22 22:43:48 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-10-21 12:38:27 +0200
commit8f7c4114db841497e1148598e22548dd1f700b22 (patch)
tree19a2e0de049300aceb0e252410ebfa5703975282 /drivers/gpu
parent3f3f0cecdba1e338b2ee75b63b7418b68eef56c7 (diff)
downloadlinux-stable-8f7c4114db841497e1148598e22548dd1f700b22.tar.gz
linux-stable-8f7c4114db841497e1148598e22548dd1f700b22.tar.bz2
linux-stable-8f7c4114db841497e1148598e22548dd1f700b22.zip
drm/omap: dss: Fix refcount leak bugs
[ Upstream commit 8b42057e62120813ebe9274f508fa785b7cab33a ] 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 Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/omapdrm/dss/dss.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/omapdrm/dss/dss.c b/drivers/gpu/drm/omapdrm/dss/dss.c
index 0399f3390a0a..c4febb861910 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.c
+++ b/drivers/gpu/drm/omapdrm/dss/dss.c
@@ -1176,6 +1176,7 @@ static void __dss_uninit_ports(struct dss_device *dss, unsigned int num_ports)
default:
break;
}
+ of_node_put(port);
}
}
@@ -1208,11 +1209,13 @@ static int dss_init_ports(struct dss_device *dss)
default:
break;
}
+ of_node_put(port);
}
return 0;
error:
+ of_node_put(port);
__dss_uninit_ports(dss, i);
return r;
}