From: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
To: Yaxiong Tian <iambestgod@outlook.com>
Cc: maarten.lankhorst@linux.intel.com, mripard@kernel.org,
tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch,
linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
Yaxiong Tian <tianyaxiong@kylinos.cn>
Subject: Re: [PATCH] drm/debugfs: fix memory leak in drm_debugfs_remove_files()
Date: Thu, 28 Dec 2023 15:04:37 +0100 [thread overview]
Message-ID: <ZY2AdV1DP6YnSh6g@linux.intel.com> (raw)
In-Reply-To: <PUZPR01MB4775A8F67AE31D6A4927E6B7D59EA@PUZPR01MB4775.apcprd01.prod.exchangelabs.com>
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
>
prev parent reply other threads:[~2023-12-28 16:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-28 8:07 [PATCH] drm/debugfs: fix memory leak in drm_debugfs_remove_files() Yaxiong Tian
2023-12-28 14:04 ` Stanislaw Gruszka [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZY2AdV1DP6YnSh6g@linux.intel.com \
--to=stanislaw.gruszka@linux.intel.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=iambestgod@outlook.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=tianyaxiong@kylinos.cn \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox