Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

phy: ti: j721e-wiz: add missing call to of_node_put()

In one of the error paths of the for_each_child_of_node() loop in
of_property_read_u32, add missing call to of_node_put().

Fix the following coccicheck warning:
./drivers/phy/ti/phy-j721e-wiz.c:786:1-23: WARNING: Function
"for_each_child_of_node" should have of_node_put() before return around
line 795.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/1614244674-66556-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Yang Li and committed by
Vinod Koul
f26fde36 982313c3

+1
+1
drivers/phy/ti/phy-j721e-wiz.c
··· 1104 1104 1105 1105 ret = of_property_read_u32(subnode, "reg", &reg); 1106 1106 if (ret) { 1107 + of_node_put(subnode); 1107 1108 dev_err(dev, 1108 1109 "%s: Reading \"reg\" from \"%s\" failed: %d\n", 1109 1110 __func__, subnode->name, ret);