lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 5 May 2022 09:30:44 +0800
From:   Yang Yingliang <yangyingliang@...wei.com>
To:     Jakub Kicinski <kuba@...nel.org>
CC:     <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
        <ioana.ciornei@....com>, <davem@...emloft.net>,
        <robert-ionut.alexa@....com>
Subject: Re: [PATCH] net: dpaa2-mac: add missing of_node_put() in
 dpaa2_mac_get_node()

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@...wei.com>
>> Signed-off-by: Yang Yingliang <yangyingliang@...wei.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
> .

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ