Re: [PATCH] net: ethernet: renesas: rswitch: fix device_node refcount leak in rswitch_get_port_node()
Geert Uytterhoeven <[email protected]>
| Newsgroups | org.kernel.vger.linux-renesas-soc,org.kernel.vger.netdev |
|---|---|
| Message-ID | <CAMuHMdX0H-uj4VYdrsFT2ThRdEhX6Tu9V-A+gdonxGXU0OvENQ@mail.gmail.com> |
Hi Manush, Thanks for your patch! On Thu, 13 Aug 2026 at 13:11, Manush Prajwal <[email protected]> wrote: > On an of_property_read_u32() failure, rswitch_get_port_node() sets > port to NULL and jumps to the out label before releasing the s/before/without/? > reference the for_each_available_child_of_node() iterator was holding > on it. Once port is overwritten with NULL, that reference can never be > released since out: only puts "ports", the parent node. Call > of_node_put(port) before clearing it. > > Signed-off-by: Manush Prajwal <[email protected]> For the actual code change: Reviewed-by: Geert Uytterhoeven <[email protected]> Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds