Re: [PATCH v4] net: ethernet: renesas: rswitch: fix device_node refcount leak in rswitch_get_port_node()
From: Andrew Lunn
Date: Mon Aug 24 2026 - 09:22:18 EST
On Mon, Aug 24, 2026 at 10:15:15AM +0200, Markus Elfring wrote:
> …
> > Rework the function around for_each_available_child_of_node_scoped()
> > instead of adding a manual of_node_put(), so the iterator's reference
> > is dropped automatically on every exit path. Since port is the
> > function's return value, take an explicit reference with of_node_get()
> > on the match before breaking out of the loop.
>
> How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?
>
> See also:
> * https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.2#n145
> * https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v7.2#n34
Hi Markus
The stable rules include the statement, the bug being fixed must
bother somebody. Do you know of somebody bothered by the reference
leak?
Andrew