]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: microchip: ksz_common: Fix refcount leak bug
authorLiang He <windhl@126.com>
Thu, 14 Jul 2022 15:31:38 +0000 (23:31 +0800)
committerJakub Kicinski <kuba@kernel.org>
Fri, 15 Jul 2022 23:44:53 +0000 (16:44 -0700)
commit8f74d4c6237641e6ed66c57d49ce675132f44920
tree08e0f92cedf8846f8e159d4e067371e394831751
parent9bae99d42476054cd8d5958a683f539fac3b51c6
net: dsa: microchip: ksz_common: Fix refcount leak bug

In ksz_switch_register(), we should call of_node_put() for the
reference returned by of_get_child_by_name() which has increased
the refcount.

Fixes: 0c1355e3344d ("net: dsa: microchip: really look for phy-mode in port nodes")
Signed-off-by: Liang He <windhl@126.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20220714153138.375919-1-windhl@126.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/dsa/microchip/ksz_common.c