From: sashiko-bot@kernel.org
To: "Ruoyu Wang" <ruoyuw560@gmail.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v2] perf/dwc_pcie: Fix PCI device reference leak in probe
Date: Thu, 20 Aug 2026 14:03:07 +0000 [thread overview]
Message-ID: <20260820140307.8C8F01F00A3D@smtp.kernel.org> (raw)
In-Reply-To: <20260820135611.3901886-1-ruoyuw560@gmail.com>
> pci_get_domain_bus_and_slot() returns a referenced PCI device. When the
> subsequent RAS DES capability lookup fails, dwc_pcie_pmu_probe() returns
> -ENODEV without releasing that reference. Repeated failed probes can
> therefore keep the PCI device allocated after removal.
>
> Declare the looked-up device with __free(pci_dev_put), so the temporary
> reference is released on every return path. Keeping the reference scoped
> to the whole probe also covers all later uses of the device during
> initialization.
>
> This issue was found by a static analysis checker and confirmed by manual
> source review.
>
> Fixes: 7f35b429802a ("perf/dwc_pcie: fix duplicate pci_dev devices")
> Suggested-by: Markus Elfring <Markus.Elfring@web.de>
> Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260820135611.3901886-1-ruoyuw560@gmail.com?part=1
next prev parent reply other threads:[~2026-08-20 14:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-20 13:56 [PATCH v2] perf/dwc_pcie: Fix PCI device reference leak in probe Ruoyu Wang
2026-08-20 14:03 ` sashiko-bot [this message]
2026-08-20 14:16 ` Markus Elfring
[not found] ` <CAK_7xqwRdXEe63YoMNE5KtLKA3+Nx=qVYj_mqfJmTVjb2-f-cQ@mail.gmail.com>
2026-08-20 14:43 ` [v2] " 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=20260820140307.8C8F01F00A3D@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=ruoyuw560@gmail.com \
--cc=sashiko-reviews@lists.linux.dev \
/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 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.