summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorkernel test robot <lkp@intel.com>2021-07-11 18:12:56 +0200
committerDavid S. Miller <davem@davemloft.net>2021-07-11 10:01:55 -0700
commit84f7e0bb4809f4497124b6b6904c07c8a0c73c58 (patch)
tree7e2364910f30fe64dbfbfb7d882b3c1a13d57bf8 /drivers
parent222722bc6ebfabf5d54467070f05cf9c0a55ea8c (diff)
downloadlinux-stable-84f7e0bb4809f4497124b6b6904c07c8a0c73c58.tar.gz
linux-stable-84f7e0bb4809f4497124b6b6904c07c8a0c73c58.tar.bz2
linux-stable-84f7e0bb4809f4497124b6b6904c07c8a0c73c58.zip
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.c4
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);
}