Re: [PATCH v3] net: ethernet: renesas: rswitch: fix device_node refcount leak in rswitch_get_port_node()
Andrew Lunn <[email protected]>
| Newsgroups | org.kernel.vger.linux-renesas-soc,org.kernel.vger.netdev |
|---|---|
| Message-ID | <[email protected]> |
> - for_each_available_child_of_node(ports, port) {
> - err = of_property_read_u32(port, "reg", &index);
> - if (err < 0) {
> - port = NULL;
> - goto out;
> - }
> - if (index == rdev->etha->index)
> + for_each_available_child_of_node_scoped(ports, child) {
> + if (of_property_read_u32(child, "reg", &index))
> + break;
Why did you change this?
Please keep the changes minimal, only change what must be changed.
I doubt you have tested this code in any way, so the change has
risk. By keeping the change as small as possible, you keep the risk
lower, so you are less likely to break it.
Andrew