linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] phy: rockchip-inno-usb2: fix for_each_child.cocci warnings
@ 2021-06-23 14:23 Julia Lawall
  0 siblings, 0 replies; only message in thread
From: Julia Lawall @ 2021-06-23 14:23 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Heiko Stuebner, linux-kernel,
	linux-arm-kernel, linux-rockchip
  Cc: kbuild-all, linux-kernel, Sumera Priyadarsini

From: kernel test robot <lkp@intel.com>

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>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   0c18f29aae7ce3dadd26d8ee3505d07cc982df75
commit: 82c2d81361ecd142a54e84a9da1e287113314a4f coccinelle: iterators: Add for_each_child.cocci script
:::::: branch date: 20 hours ago
:::::: commit date: 8 months ago

Please take the patch only if it's a positive warning. Thanks!

 phy-rockchip-inno-usb2.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
+++ b/drivers/phy/rockchip/phy-rockchip-inno-usb2.c
@@ -1180,8 +1180,10 @@ static int rockchip_usb2phy_probe(struct

 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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-23 14:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23 14:23 [PATCH] phy: rockchip-inno-usb2: fix for_each_child.cocci warnings Julia Lawall

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).