]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: lantiq_gswip: Fix refcount leak in gswip_gphy_fw_list
authorMiaoqian Lin <linmq006@gmail.com>
Sun, 5 Jun 2022 07:23:34 +0000 (11:23 +0400)
committerJakub Kicinski <kuba@kernel.org>
Wed, 8 Jun 2022 03:45:14 +0000 (20:45 -0700)
commita391bd1fb481f81e25a80b8d9cfe72f6012e4b4a
tree867375ab8f91722c4e406cead30a6458db6f1bde
parent9fb4abcc83b70953e71d2537c809719afe610af2
net: dsa: lantiq_gswip: Fix refcount leak in gswip_gphy_fw_list

Every iteration of for_each_available_child_of_node() decrements
the reference count of the previous node.
when breaking early from a for_each_available_child_of_node() loop,
we need to explicitly call of_node_put() on the gphy_fw_np.
Add missing of_node_put() to avoid refcount leak.

Fixes: 82a04c5f5814 ("net: dsa: Add Lantiq / Intel DSA driver for vrx200")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220605072335.11257-1-linmq006@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/lantiq_gswip.c