[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <e165fb81-8d96-49dc-9bfd-85ae79ef4f64@icloud.com>
Date: Sun, 20 Oct 2024 16:18:03 +0800
From: Zijun Hu <zijun_hu@...oud.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
Vinod Koul <vkoul@...nel.org>, Kishon Vijay Abraham I <kishon@...nel.org>,
Felipe Balbi <balbi@...com>, Greg Kroah-Hartman
<gregkh@...uxfoundation.org>, Rob Herring <robh@...nel.org>,
Arnd Bergmann <arnd@...db.de>, Lee Jones <lee@...nel.org>
Cc: stable@...r.kernel.org, linux-phy@...ts.infradead.org,
netdev@...r.kernel.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, Zijun Hu <quic_zijuhu@...cinc.com>
Subject: Re: [PATCH 5/6] phy: core: Add missing of_node_put() in
of_phy_provider_lookup()
On 2024/10/20 15:23, Christophe JAILLET wrote:
> Le 20/10/2024 à 07:27, Zijun Hu a écrit :
>> From: Zijun Hu <quic_zijuhu@...cinc.com>
[snip]
>> ---
>> drivers/phy/phy-core.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
>> index 967878b78797..24bd619a33dd 100644
>> --- a/drivers/phy/phy-core.c
>> +++ b/drivers/phy/phy-core.c
>> @@ -143,10 +143,11 @@ static struct phy_provider
>> *of_phy_provider_lookup(struct device_node *node)
>> list_for_each_entry(phy_provider, &phy_provider_list, list) {
>> if (phy_provider->dev->of_node == node)
>> return phy_provider;
>> -
>> for_each_child_of_node(phy_provider->children, child)
>> - if (child == node)
>> + if (child == node) {
>> + of_node_put(child);
>> return phy_provider;
>> + }
>
> Hi,
>
> Maybe for_each_child_of_node_scoped() to slightly simplify things at the
> same time?
>
thank you for code review.
it does not use _scoped() since for_each_child_of_node() usage here is
very simple and only has one early exit, _scoped() normally is for
complex case.
i maybe use _scoped() in next revision if one more reviewer also prefers
it.
thank you.
>> }
>> return ERR_PTR(-EPROBE_DEFER);
>>
>
Powered by blists - more mailing lists