mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
	<ioana.ciornei@nxp.com>, <davem@davemloft.net>,
	<robert-ionut.alexa@nxp.com>
Subject: Re: [PATCH] net: dpaa2-mac: add missing of_node_put() in dpaa2_mac_get_node()
Date: Thu, 5 May 2022 09:30:44 +0800	[thread overview]
Message-ID: <61393ca9-618c-017b-c463-93d0afe33c12@huawei.com> (raw)
In-Reply-To: <20220429192950.5a1d23cc@kernel.org>

Hi,

On 2022/4/30 10:29, Jakub Kicinski wrote:
> On Thu, 28 Apr 2022 18:01:27 +0800 Yang Yingliang wrote:
>> Add missing of_node_put() in error path in dpaa2_mac_get_node().
>>
>> Fixes: 5b1e38c0792c ("dpaa2-mac: bail if the dpmacs fwnode is not found")
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
>> ---
>>   drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
>> index c48811d3bcd5..a91446685526 100644
>> --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
>> +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c
>> @@ -108,8 +108,11 @@ static struct fwnode_handle *dpaa2_mac_get_node(struct device *dev,
>>   		return ERR_PTR(-EPROBE_DEFER);
>>   	}
>>   
>> -	if (!parent)
>> +	if (!parent) {
>> +		if (dpmacs)
>> +			of_node_put(dpmacs);
> of_node_put() accepts NULL. I know this because unlike you I did
> at least the bare minimum looking at the surrounding code and saw
> other places not checking if it's NULL.
I missed that, I will send a v2 later.

Thanks,
Yang
> .

      reply	other threads:[~2022-05-05  1:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 10:01 Yang Yingliang
2022-04-30  2:29 ` Jakub Kicinski
2022-05-05  1:30   ` Yang Yingliang [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=61393ca9-618c-017b-c463-93d0afe33c12@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=davem@davemloft.net \
    --cc=ioana.ciornei@nxp.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=robert-ionut.alexa@nxp.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

all inboxes | Powered by JetHome®