Thread (18 messages) 18 messages, 5 authors, 2025-02-05

Re: [PATCH 3/4] nvmem: imx-ocotp: Support accessing controller for i.MX8M Nano

From: Krzysztof Kozlowski <krzk@kernel.org>
Date: 2025-01-31 14:07:55
Also in: imx, linux-devicetree, lkml

On 31/01/2025 14:50, Alexander Stein wrote:
quoted
quoted
+
+		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.
quoted
if (args.np != dev->of_node) {
	of_node_put(args.np);
	continue;
}
of_node_put(args.np);
Best regards,
Krzysztof
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help