From: liulongfang <liulongfang@huawei.com>
To: Miaoqian Lin <linmq006@gmail.com>,
Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>,
Jason Gunthorpe <jgg@ziepe.ca>, Yishai Hadas <yishaih@nvidia.com>,
Kevin Tian <kevin.tian@intel.com>,
Alex Williamson <alex.williamson@redhat.com>,
<kvm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <stable@vger.kernel.org>
Subject: Re: [PATCH] hisi_acc_vfio_pci: Fix reference leak in hisi_acc_vfio_debug_init
Date: Tue, 2 Sep 2025 10:23:08 +0800 [thread overview]
Message-ID: <47e97b77-edfa-3a90-f74c-068b24afe917@huawei.com> (raw)
In-Reply-To: <20250901081809.2286649-1-linmq006@gmail.com>
On 2025/9/1 16:18, Miaoqian Lin wrote:
> The debugfs_lookup() function returns a dentry with an increased reference
> count that must be released by calling dput().
>
> Fixes: b398f91779b8 ("hisi_acc_vfio_pci: register debugfs for hisilicon migration driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
> drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> index 2149f49aeec7..1710485cbbec 100644
> --- a/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> +++ b/drivers/vfio/pci/hisilicon/hisi_acc_vfio_pci.c
> @@ -1611,8 +1611,10 @@ static void hisi_acc_vfio_debug_init(struct hisi_acc_vf_core_device *hisi_acc_vd
> }
>
> migf = kzalloc(sizeof(*migf), GFP_KERNEL);
> - if (!migf)
> + if (!migf) {
> + dput(vfio_dev_migration);
> return;
> + }
> hisi_acc_vdev->debug_migf = migf;
>
> vfio_hisi_acc = debugfs_create_dir("hisi_acc", vfio_dev_migration);
> @@ -1622,6 +1624,8 @@ static void hisi_acc_vfio_debug_init(struct hisi_acc_vf_core_device *hisi_acc_vd
> hisi_acc_vf_migf_read);
> debugfs_create_devm_seqfile(dev, "cmd_state", vfio_hisi_acc,
> hisi_acc_vf_debug_cmd);
> +
> + dput(vfio_dev_migration);
> }
>
Reviewed-by: Longfang Liu <liulongfang@huawei.com>
Thanks!
Longfang.
> static void hisi_acc_vf_debugfs_exit(struct hisi_acc_vf_core_device *hisi_acc_vdev)
>
next prev parent reply other threads:[~2025-09-02 2:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-01 8:18 Miaoqian Lin
2025-09-02 2:23 ` liulongfang [this message]
2025-09-02 11:47 ` Markus Elfring
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=47e97b77-edfa-3a90-f74c-068b24afe917@huawei.com \
--to=liulongfang@huawei.com \
--cc=alex.williamson@redhat.com \
--cc=jgg@ziepe.ca \
--cc=kevin.tian@intel.com \
--cc=kvm@vger.kernel.org \
--cc=linmq006@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=stable@vger.kernel.org \
--cc=yishaih@nvidia.com \
/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
all inboxes | Powered by JetHome®