From: Bjorn Helgaas <helgaas@kernel.org>
To: Miaoqian Lin <linmq006@gmail.com>
Cc: "Nicolas Saenz Julienne" <nsaenz@kernel.org>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@broadcom.com>,
"Jim Quinlan" <jim2101024@gmail.com>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"Lorenzo Pieralisi" <lorenzo.pieralisi@arm.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Marc Zyngier" <maz@kernel.org>,
"Andrew Murray" <amurray@thegoodpenguin.co.uk>,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] PCI: brcmstb: Fix refcount leak in brcm_pcie_probe
Date: Wed, 8 Jun 2022 15:25:57 -0500 [thread overview]
Message-ID: <20220608202557.GA419456@bhelgaas> (raw)
In-Reply-To: <20220603130849.38252-1-linmq006@gmail.com>
On Fri, Jun 03, 2022 at 05:08:49PM +0400, Miaoqian Lin wrote:
> of_parse_phandle() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when not need anymore.
> Add missing of_node_put() to avoid refcount leak.
>
> Fixes: 40ca1bf580ef ("PCI: brcmstb: Add MSI support")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Applied with Rob's reviewed-by to pci/ctrl/brcmstb for v5.20, thanks!
> ---
> changes in v2:
> - update Fixes tag.
> v1 Link: https://lore.kernel.org/r/20220602125003.10723-1-linmq006@gmail.com
> ---
> drivers/pci/controller/pcie-brcmstb.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
> index 375c0c40bbf8..e3b673441a11 100644
> --- a/drivers/pci/controller/pcie-brcmstb.c
> +++ b/drivers/pci/controller/pcie-brcmstb.c
> @@ -1597,8 +1597,10 @@ static int brcm_pcie_probe(struct platform_device *pdev)
> ret = brcm_pcie_enable_msi(pcie);
> if (ret) {
> dev_err(pcie->dev, "probe of internal MSI failed");
> + of_node_put(msi_np);
> goto fail;
> }
> + of_node_put(msi_np);
> }
>
> bridge->ops = pcie->type == BCM7425 ? &brcm_pcie_ops32 : &brcm_pcie_ops;
> --
> 2.25.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2022-06-08 20:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-03 13:08 [PATCH v2] PCI: brcmstb: Fix refcount leak in brcm_pcie_probe Miaoqian Lin
2022-06-06 21:33 ` Rob Herring
2022-06-08 20:25 ` Bjorn Helgaas [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=20220608202557.GA419456@bhelgaas \
--to=helgaas@kernel.org \
--cc=amurray@thegoodpenguin.co.uk \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bhelgaas@google.com \
--cc=f.fainelli@gmail.com \
--cc=jim2101024@gmail.com \
--cc=kw@linux.com \
--cc=linmq006@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=maz@kernel.org \
--cc=nsaenz@kernel.org \
--cc=robh@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).