]> git.baikalelectronics.ru Git - kernel.git/commit
net: altera: Fix refcount leak in altera_tse_mdio_create
authorMiaoqian Lin <linmq006@gmail.com>
Tue, 7 Jun 2022 04:11:43 +0000 (08:11 +0400)
committerJakub Kicinski <kuba@kernel.org>
Thu, 9 Jun 2022 03:52:41 +0000 (20:52 -0700)
commit556fb8c49f2f75431de9969074e141b4214cec8f
tree83baef0e91584f4680fbea5ade26259b4f6b34e8
parenta5d778c6da3d1a5aa4a7a1cedd36df3f0a611da0
net: altera: Fix refcount leak in altera_tse_mdio_create

Every iteration of for_each_child_of_node() decrements
the reference count of the previous node.
When break from a for_each_child_of_node() loop,
we need to explicitly call of_node_put() on the child node when
not need anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: 8a1a6e9b5a3d ("Altera TSE: Add main and header file for Altera Ethernet Driver")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220607041144.7553-1-linmq006@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/altera/altera_tse_main.c