Skip to content

Commit 84f7e0b

Browse files
intel-lab-lkpdavem330
authored andcommitted
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 <[email protected]> Reported-by: kernel test robot <[email protected]> Signed-off-by: kernel test robot <[email protected]> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 222722b commit 84f7e0b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/dsa/microchip/ksz_common.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,8 +419,10 @@ int ksz_switch_register(struct ksz_device *dev,
419419
if (of_property_read_u32(port, "reg",
420420
&port_num))
421421
continue;
422-
if (!(dev->port_mask & BIT(port_num)))
422+
if (!(dev->port_mask & BIT(port_num))) {
423+
of_node_put(port);
423424
return -EINVAL;
425+
}
424426
of_get_phy_mode(port,
425427
&dev->ports[port_num].interface);
426428
}

0 commit comments

Comments
 (0)