From: "Liang He" <windhl@126.com>
To: "Bjorn Helgaas" <helgaas@kernel.org>
Cc: jim2101024@gmail.com, f.fainelli@gmail.com,
bcm-kernel-feedback-list@broadcom.com, lpieralisi@kernel.org,
robh@kernel.org, kw@linux.com, bhelgaas@google.com,
p.zabel@pengutronix.de, linux-pci@vger.kernel.org,
linmq006@gmail.com
Subject: Re:Re: [PATCH] pci: controller: brcmstb: Move of_node_put() out of 'if' in brcm_pcie_probe
Date: Fri, 15 Jul 2022 07:58:54 +0800 (CST) [thread overview]
Message-ID: <600e0df6.13d.181ff26b0cd.Coremail.windhl@126.com> (raw)
In-Reply-To: <20220714164726.GA1021692@bhelgaas>
At 2022-07-15 00:47:26, "Bjorn Helgaas" <helgaas@kernel.org> wrote:
>On Mon, Jul 04, 2022 at 02:55:01PM +0800, Liang He wrote:
>> Commit 3a87cb8f6a ("Fix refcount leak in brcm_pcie_probe()") adds
>> of_node_put() for of_parse_phandle() in fail path but not adds it
>> correctly in normal path. We should move the second of_node_put()
>> out of the 'if(pci_msi_enabled() && msi_np == pcie->np)'.
>>
>> Fixes: 3a87cb8f6a ("Fix refcount leak in brcm_pcie_probe()")
>> Co-authored-by: Miaoqian Lin <linmq006@gmail.com>
>> Signed-off-by: Liang He <windhl@126.com>
>> ---
>> Patched file has been compiled test in next branch.
>>
>> drivers/pci/controller/pcie-brcmstb.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c
>> index 48a7148376d4..80e19d053e9f 100755
>> --- a/drivers/pci/controller/pcie-brcmstb.c
>> +++ b/drivers/pci/controller/pcie-brcmstb.c
>> @@ -1413,8 +1413,8 @@ static int brcm_pcie_probe(struct platform_device *pdev)
>> of_node_put(msi_np);
>> goto fail;
>> }
>> - of_node_put(msi_np);
>> }
>> + of_node_put(msi_np);
>
>Can we just move the of_parse_phandle() and related checking into
>brcm_pcie_enable_msi()? It can return success without doing anything
>if !pci_msi_enabled() or msi_np != pcie_np.
>
>If you don't want to do that, please just send a revised version of
>3a87cb8f6a72 ("PCI: brcmstb: Fix refcount leak in brcm_pcie_probe()").
>That's not upstream yet, and I don't want to clutter the git history
>with a fix of a fix.
>
Thanks, Bjorn,
We will make a better version or a revised version soon.
Liang
>> bridge->ops = pcie->type == BCM7425 ? &brcm_pcie_ops32 : &brcm_pcie_ops;
>> bridge->sysdata = pcie;
>> --
>> 2.25.1
>>
prev parent reply other threads:[~2022-07-15 0:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 6:55 [PATCH] pci: controller: brcmstb: Move of_node_put() out of 'if' in brcm_pcie_probe Liang He
2022-07-14 16:47 ` Bjorn Helgaas
2022-07-14 23:58 ` Liang He [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=600e0df6.13d.181ff26b0cd.Coremail.windhl@126.com \
--to=windhl@126.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=bhelgaas@google.com \
--cc=f.fainelli@gmail.com \
--cc=helgaas@kernel.org \
--cc=jim2101024@gmail.com \
--cc=kw@linux.com \
--cc=linmq006@gmail.com \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=p.zabel@pengutronix.de \
--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 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.