diff options
author | kernel test robot <lkp@intel.com> | 2021-07-11 19:12:56 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-07-11 20:01:55 +0300 |
commit | 84f7e0bb4809f4497124b6b6904c07c8a0c73c58 (patch) | |
tree | 7e2364910f30fe64dbfbfb7d882b3c1a13d57bf8 /drivers | |
parent | 222722bc6ebfabf5d54467070f05cf9c0a55ea8c (diff) | |
download | linux-84f7e0bb4809f4497124b6b6904c07c8a0c73c58.tar.xz |
dsa: fix for_each_child.cocci warnings
For_each_available_child_of_node should have of_node_put() before
return around line 423.
Generated by: scripts/coccinelle/iterators/for_each_child.cocci
CC: Alexander Lobakin <alobakin@pm.me>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/dsa/microchip/ksz_common.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/microchip/ksz_common.c index a7e5ac60baef..1542bfb8b5e5 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -419,8 +419,10 @@ int ksz_switch_register(struct ksz_device *dev, if (of_property_read_u32(port, "reg", &port_num)) continue; - if (!(dev->port_mask & BIT(port_num))) + if (!(dev->port_mask & BIT(port_num))) { + of_node_put(port); return -EINVAL; + } of_get_phy_mode(port, &dev->ports[port_num].interface); } |