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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux