]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: Fix an error handling path in 'dsa_switch_parse_ports_of()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 18 Oct 2021 19:59:00 +0000 (21:59 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 19 Oct 2021 22:41:16 +0000 (15:41 -0700)
commit70925e002cce5d40f7d90431d9b04e3e21a869cb
tree870105ca1f7b13af58eb1e0d7b1e91b6f8142028
parent63f88e1c23d0c225a62f46357932f6228bfd7100
net: dsa: Fix an error handling path in 'dsa_switch_parse_ports_of()'

If we return before the end of the 'for_each_child_of_node()' iterator, the
reference taken on 'port' must be released.

Add the missing 'of_node_put()' calls.

Fixes: da65645b5ea7 ("net: dsa: Add new binding implementation")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/15d5310d1d55ad51c1af80775865306d92432e03.1634587046.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/dsa/dsa2.c