* [PATCH] drm/arcgpu: fix device node leak
@ 2025-11-19 12:03 Luca Ceresoli
2025-11-19 19:25 ` Markus Elfring
0 siblings, 1 reply; 2+ messages in thread
From: Luca Ceresoli @ 2025-11-19 12:03 UTC (permalink / raw)
To: Simona Vetter, Alexey Brodkin, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter
Cc: Hui Pu, Thomas Petazzoni, dri-devel, linux-kernel, stable, Luca Ceresoli
This function gets a device_node reference via
of_graph_get_remote_port_parent() and stores it in encoder_node, but necer
puts that reference. Add it.
There used to be a of_node_put(encoder_node) but it has been removed by
mistake during a rework in commit 3ea66a794fdc ("drm/arc: Inline
arcpgu_drm_hdmi_init").
Fixes: 3ea66a794fdc ("drm/arc: Inline arcpgu_drm_hdmi_init")
Cc: stable@vger.kernel.org
Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
---
drivers/gpu/drm/tiny/arcpgu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
index 7cf0f0ea1bfe..c74466ea2535 100644
--- a/drivers/gpu/drm/tiny/arcpgu.c
+++ b/drivers/gpu/drm/tiny/arcpgu.c
@@ -250,7 +250,8 @@ DEFINE_DRM_GEM_DMA_FOPS(arcpgu_drm_ops);
static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
{
struct platform_device *pdev = to_platform_device(arcpgu->drm.dev);
- struct device_node *encoder_node = NULL, *endpoint_node = NULL;
+ struct device_node *encoder_node __free(device_node) = NULL;
+ struct device_node *endpoint_node = NULL;
struct drm_connector *connector = NULL;
struct drm_device *drm = &arcpgu->drm;
int ret;
---
base-commit: 949f1fd2225baefbea2995afa807dba5cbdb6bd3
change-id: 20251119-drm-arcgpu-fix-device-node-leak-f909bc1f7fbb
Best regards,
--
Luca Ceresoli <luca.ceresoli@bootlin.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/arcgpu: fix device node leak
2025-11-19 12:03 [PATCH] drm/arcgpu: fix device node leak Luca Ceresoli
@ 2025-11-19 19:25 ` Markus Elfring
0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2025-11-19 19:25 UTC (permalink / raw)
To: Luca Ceresoli, dri-devel
Cc: stable, LKML, Alexey Brodkin, David Airlie, Hui Pu,
Maarten Lankhorst, Maxime Ripard, Simona Vetter,
Thomas Petazzoni, Thomas Zimmermann
> This function gets a device_node reference via
> of_graph_get_remote_port_parent() and stores it in encoder_node, but necer
never?
> puts that reference. Add it.
…
> +++ b/drivers/gpu/drm/tiny/arcpgu.c
> @@ -250,7 +250,8 @@ DEFINE_DRM_GEM_DMA_FOPS(arcpgu_drm_ops);
> static int arcpgu_load(struct arcpgu_drm_private *arcpgu)
> {
> struct platform_device *pdev = to_platform_device(arcpgu->drm.dev);
> - struct device_node *encoder_node = NULL, *endpoint_node = NULL;
> + struct device_node *encoder_node __free(device_node) = NULL;
> + struct device_node *endpoint_node = NULL;
> struct drm_connector *connector = NULL;
> struct drm_device *drm = &arcpgu->drm;
> int ret;
May the scopes be reduced for any of these variables?
Regards,
Markus
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-11-19 19:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-19 12:03 [PATCH] drm/arcgpu: fix device node leak Luca Ceresoli
2025-11-19 19:25 ` Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®