From: Miles Chen <miles.chen@mediatek.com>
To: <linmq006@gmail.com>
Cc: <bhelgaas@google.com>, <chuanjia.liu@mediatek.com>,
<jianjun.wang@mediatek.com>, <kw@linux.com>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>,
<linux-mediatek@lists.infradead.org>, <linux-pci@vger.kernel.org>,
<lorenzo.pieralisi@arm.com>, <matthias.bgg@gmail.com>,
<robh@kernel.org>, <ryder.lee@mediatek.com>
Subject: Re: [PATCH] PCI: mediatek: Fix refcount leak in mtk_pcie_subsys_powerup
Date: Thu, 10 Mar 2022 14:56:12 +0800 [thread overview]
Message-ID: <20220310065612.26452-1-miles.chen@mediatek.com> (raw)
In-Reply-To: <20220309091953.5630-1-linmq006@gmail.com>
Hi Miaoqian,
> The of_find_compatible_node() function returns a node pointer with
> refcount incremented, We should use of_node_put() on it when done
> Add the missing of_node_put() to release the refcount.
>
> Fixes: 87e8657ba99c ("PCI: mediatek: Add new method to get shared pcie-cfg base address")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
> drivers/pci/controller/pcie-mediatek.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c
> index ddfbd4aebdec..be8bd919cb88 100644
> --- a/drivers/pci/controller/pcie-mediatek.c
> +++ b/drivers/pci/controller/pcie-mediatek.c
> @@ -1008,6 +1008,7 @@ static int mtk_pcie_subsys_powerup(struct mtk_pcie *pcie)
> "mediatek,generic-pciecfg");
> if (cfg_node) {
> pcie->cfg = syscon_node_to_regmap(cfg_node);
> + of_node_put(cfg_node);
> if (IS_ERR(pcie->cfg))
> return PTR_ERR(pcie->cfg);
> }
Thanks for this patch.
Reviewed-by: Miles Chen <miles.chen@mediatek.com>
Thanks,
Miles
next prev parent reply other threads:[~2022-03-10 6:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-09 9:19 [PATCH] PCI: mediatek: Fix refcount leak in mtk_pcie_subsys_powerup Miaoqian Lin
2022-03-10 6:56 ` Miles Chen [this message]
2022-03-10 14:48 ` AngeloGioacchino Del Regno
2022-03-24 21:03 ` Rob Herring
2022-04-08 14:30 ` Lorenzo Pieralisi
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=20220310065612.26452-1-miles.chen@mediatek.com \
--to=miles.chen@mediatek.com \
--cc=bhelgaas@google.com \
--cc=chuanjia.liu@mediatek.com \
--cc=jianjun.wang@mediatek.com \
--cc=kw@linux.com \
--cc=linmq006@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=robh@kernel.org \
--cc=ryder.lee@mediatek.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;
as well as URLs for NNTP newsgroup(s).