* [PATCH] drm/debugfs: fix memory leak in drm_debugfs_remove_files()
@ 2023-12-28 8:07 ` Yaxiong Tian
0 siblings, 0 replies; 4+ messages in thread
From: Yaxiong Tian @ 2023-12-28 8:07 UTC (permalink / raw)
To: maarten.lankhorst, mripard, tzimmermann, airlied, daniel
Cc: linux-kernel, dri-devel, Yaxiong Tian
From: Yaxiong Tian <tianyaxiong@kylinos.cn>
The dentry returned by debugfs_lookup() needs to be released by calling
dput() which is missing in drm_debugfs_remove_files(). Fix this by adding
dput().
Signed-off-by: Yaxiong Tian <tianyaxiong@kylinos.cn>
---
drivers/gpu/drm/drm_debugfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index f4715a67e340..4d299152c302 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -277,6 +277,7 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
drmm_kfree(minor->dev, d_inode(dent)->i_private);
debugfs_remove(dent);
+ dput(dent);
}
return 0;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] drm/debugfs: fix memory leak in drm_debugfs_remove_files()
@ 2023-12-28 8:07 ` Yaxiong Tian
0 siblings, 0 replies; 4+ messages in thread
From: Yaxiong Tian @ 2023-12-28 8:07 UTC (permalink / raw)
To: maarten.lankhorst, mripard, tzimmermann, airlied, daniel
Cc: dri-devel, linux-kernel, Yaxiong Tian
From: Yaxiong Tian <tianyaxiong@kylinos.cn>
The dentry returned by debugfs_lookup() needs to be released by calling
dput() which is missing in drm_debugfs_remove_files(). Fix this by adding
dput().
Signed-off-by: Yaxiong Tian <tianyaxiong@kylinos.cn>
---
drivers/gpu/drm/drm_debugfs.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index f4715a67e340..4d299152c302 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -277,6 +277,7 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
drmm_kfree(minor->dev, d_inode(dent)->i_private);
debugfs_remove(dent);
+ dput(dent);
}
return 0;
}
--
2.25.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/debugfs: fix memory leak in drm_debugfs_remove_files()
2023-12-28 8:07 ` Yaxiong Tian
@ 2023-12-28 14:04 ` Stanislaw Gruszka
-1 siblings, 0 replies; 4+ messages in thread
From: Stanislaw Gruszka @ 2023-12-28 14:04 UTC (permalink / raw)
To: Yaxiong Tian
Cc: tzimmermann, linux-kernel, mripard, dri-devel, Yaxiong Tian,
airlied
On Thu, Dec 28, 2023 at 04:07:40PM +0800, Yaxiong Tian wrote:
> From: Yaxiong Tian <tianyaxiong@kylinos.cn>
>
> The dentry returned by debugfs_lookup() needs to be released by calling
> dput() which is missing in drm_debugfs_remove_files(). Fix this by adding
> dput().
>
> Signed-off-by: Yaxiong Tian <tianyaxiong@kylinos.cn>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
> ---
> drivers/gpu/drm/drm_debugfs.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
> index f4715a67e340..4d299152c302 100644
> --- a/drivers/gpu/drm/drm_debugfs.c
> +++ b/drivers/gpu/drm/drm_debugfs.c
> @@ -277,6 +277,7 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
>
> drmm_kfree(minor->dev, d_inode(dent)->i_private);
> debugfs_remove(dent);
> + dput(dent);
> }
> return 0;
> }
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/debugfs: fix memory leak in drm_debugfs_remove_files()
@ 2023-12-28 14:04 ` Stanislaw Gruszka
0 siblings, 0 replies; 4+ messages in thread
From: Stanislaw Gruszka @ 2023-12-28 14:04 UTC (permalink / raw)
To: Yaxiong Tian
Cc: maarten.lankhorst, mripard, tzimmermann, airlied, daniel,
linux-kernel, dri-devel, Yaxiong Tian
On Thu, Dec 28, 2023 at 04:07:40PM +0800, Yaxiong Tian wrote:
> From: Yaxiong Tian <tianyaxiong@kylinos.cn>
>
> The dentry returned by debugfs_lookup() needs to be released by calling
> dput() which is missing in drm_debugfs_remove_files(). Fix this by adding
> dput().
>
> Signed-off-by: Yaxiong Tian <tianyaxiong@kylinos.cn>
Reviewed-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
> ---
> drivers/gpu/drm/drm_debugfs.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
> index f4715a67e340..4d299152c302 100644
> --- a/drivers/gpu/drm/drm_debugfs.c
> +++ b/drivers/gpu/drm/drm_debugfs.c
> @@ -277,6 +277,7 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
>
> drmm_kfree(minor->dev, d_inode(dent)->i_private);
> debugfs_remove(dent);
> + dput(dent);
> }
> return 0;
> }
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-28 16:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-28 8:07 [PATCH] drm/debugfs: fix memory leak in drm_debugfs_remove_files() Yaxiong Tian
2023-12-28 8:07 ` Yaxiong Tian
2023-12-28 14:04 ` Stanislaw Gruszka
2023-12-28 14:04 ` Stanislaw Gruszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.