phy: rockchip-inno-usb2: fix for_each_child.cocci warnings

For_each_available_child_of_node should have of_node_put()
before break around line 1184.  The other jumps out of the
loop do contain the put.

Generated by: scripts/coccinelle/iterators/for_each_child.cocci

CC: Sumera Priyadarsini <sylphrenadin@gmail.com>
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>
Link: https://lore.kernel.org/r/alpine.DEB.2.22.394.2106231617540.99238@hadrien
Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
kernel test robot 2021-06-23 16:23:30 +02:00 committed by Vinod Koul
parent c1302e8ce5
commit 1716e49eb8

View File

@ -1180,8 +1180,10 @@ static int rockchip_usb2phy_probe(struct platform_device *pdev)
next_child:
/* to prevent out of boundary */
if (++index >= rphy->phy_cfg->num_ports)
if (++index >= rphy->phy_cfg->num_ports) {
of_node_put(child_np);
break;
}
}
provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate);