From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Andrew Donnellan <ajd@linux.ibm.com>,
Miaoqian Lin <linmq006@gmail.com>,
Frederic Barrat <fbarrat@linux.ibm.com>,
Arnd Bergmann <arnd@arndb.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Christophe Lombard <clombard@linux.vnet.ibm.com>,
"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Bjorn Helgaas <bhelgaas@google.com>
Subject: Re: [PATCH] cxl: Fix refcount leak in cxl_calc_capp_routing
Date: Mon, 14 Nov 2022 12:42:20 +0000 [thread overview]
Message-ID: <f818d7f2-eeae-8a98-30a6-0c47bef9462e@csgroup.eu> (raw)
In-Reply-To: <269ecf828ebaa4212a5be6310619aba6d8cfe41d.camel@linux.ibm.com>
Should this be applied by Bjorn as most recent changes to that file ?
Le 14/06/2022 à 12:12, Andrew Donnellan a écrit :
> On Sun, 2022-06-05 at 10:00 +0400, Miaoqian Lin wrote:
>> of_get_next_parent() returns a node pointer with refcount
>> incremented,
>> we should use of_node_put() on it when not need anymore.
>> This function only calls of_node_put() in normal path,
>> missing it in the error path.
>> Add missing of_node_put() to avoid refcount leak.
>>
>> Fixes: f24be42aab37 ("cxl: Add psl9 specific code")
>> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
>
> Thanks!
>
> Acked-by: Andrew Donnellan <ajd@linux.ibm.com>
>
>> ---
>> drivers/misc/cxl/pci.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
>> index 3de0aea62ade..62385a529d86 100644
>> --- a/drivers/misc/cxl/pci.c
>> +++ b/drivers/misc/cxl/pci.c
>> @@ -387,6 +387,7 @@ int cxl_calc_capp_routing(struct pci_dev *dev,
>> u64 *chipid,
>> rc = get_phb_index(np, phb_index);
>> if (rc) {
>> pr_err("cxl: invalid phb index\n");
>> + of_node_put(np);
>> return rc;
>> }
>>
>
>
next prev parent reply other threads:[~2022-11-14 12:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-05 6:00 [PATCH] cxl: Fix refcount leak in cxl_calc_capp_routing Miaoqian Lin
2022-06-07 9:05 ` Frederic Barrat
2022-06-14 10:12 ` Andrew Donnellan
2022-11-14 12:42 ` Christophe Leroy [this message]
2022-11-22 5:39 ` Andrew Donnellan
2022-11-30 9:23 ` Michael Ellerman
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=f818d7f2-eeae-8a98-30a6-0c47bef9462e@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=ajd@linux.ibm.com \
--cc=arnd@arndb.de \
--cc=bhelgaas@google.com \
--cc=clombard@linux.vnet.ibm.com \
--cc=fbarrat@linux.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=linmq006@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
/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).