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] [thread-next>] [day] [month] [year] [list]
Message-ID: <77e5166f-37f6-4931-b071-1c926cfe707c@kernel.org>
Date: Fri, 31 Jan 2025 15:07:49 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Alexander Stein <alexander.stein@...tq-group.com>,
 Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
 Conor Dooley <conor+dt@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
 Sascha Hauer <s.hauer@...gutronix.de>,
 Pengutronix Kernel Team <kernel@...gutronix.de>,
 Fabio Estevam <festevam@...il.com>,
 Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc: devicetree@...r.kernel.org, imx@...ts.linux.dev,
 linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 3/4] nvmem: imx-ocotp: Support accessing controller for
 i.MX8M Nano

On 31/01/2025 14:50, Alexander Stein wrote:
>>> +
>>> +		while (!of_parse_phandle_with_args(child, "access-controllers",
>>> +						   "#access-controller-cells",
>>> +						   idx++, &args)) {
>>> +			of_node_put(args.np);
>>> +			if (args.np != dev->of_node)
>>
>> You are using args.np after dropping the reference.
> 
> Indeed, but is it really a problem? The args.np pointer is still the same.
> So the comparison is unaffected.
> 
> Both branches need to drop the reference, no?

Ah, indeed, you do not use the reference except pointer comparison. It's
fine, maybe a bit less usual, but as you mentioned other alternative
also does not look good, so fine for me.

> But the following looks awefull as well.
>> if (args.np != dev->of_node) {
>> 	of_node_put(args.np);
>> 	continue;
>> }
>> of_node_put(args.np);
> 
Best regards,
Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ