From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Haotian Zhang <vulab@iscas.ac.cn>,
vkoul@kernel.org, kishon@kernel.org,
linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] phy: hisilicon: Fix OF node reference leak
Date: Mon, 16 Feb 2026 11:09:55 +0200 [thread overview]
Message-ID: <aZLe4-w0Jb50O63N@smile.fi.intel.com> (raw)
In-Reply-To: <20260216084348.e2ozdqy5unvfs7qe@skbuf>
On Mon, Feb 16, 2026 at 10:43:48AM +0200, Vladimir Oltean wrote:
> On Wed, Nov 12, 2025 at 02:22:46PM +0800, Haotian Zhang wrote:
...
> pcie_dev = bus_find_device_by_of_node(&platform_bus_type, pcie_port);
> + of_node_put(pcie_port);
> if (!pcie_dev) {
> dev_err(dev, "Didn't find pcie device\n");
> return -ENODEV;
> }
>
> Note that there exists a second reference leak bug in the same function.
> bus_find_device_by_of_node() requires put_device(pcie_dev)
Note, there is a pci_* wrapper for that.
> after it is no longer needed.
Is it only a local variable? If so, it's probably okay to put it, but that
action needs more investigations of the how the pcie_dev is being used.
Also, it might be (but I don't think it is) a (double) put_device() call
somewhere else. TL;DR: the summary of this investigation should be present
in the commit message.
--
With Best Regards,
Andy Shevchenko
--
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy
next prev parent reply other threads:[~2026-02-16 9:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-12 6:22 [PATCH] phy: hisilicon: Fix OF node reference leak Haotian Zhang
2026-02-16 8:43 ` Vladimir Oltean
2026-02-16 9:09 ` Andy Shevchenko [this message]
2026-02-16 9:11 ` Andy Shevchenko
2026-02-19 16:38 ` [PATCH v2] phy: hisilicon: hi3670: Fix OF node and device reference leaks Haotian Zhang
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=aZLe4-w0Jb50O63N@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=kishon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=olteanv@gmail.com \
--cc=vkoul@kernel.org \
--cc=vulab@iscas.ac.cn \
/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