phy: hisilicon: add missing call to of_node_put()
PATCH 1/1 phy: hisilicon: add missing call to of_node_put()
In one of the error paths of the for_each_child_of_node() loop, add missing call to of_node_put().
Fix the following coccicheck warning:
./drivers/phy/hisilicon/phy-hisi-inno-usb2.c:138:1-23: WARNING: Function "for_each_child_of_node" should have of_node_put() before break around line 158.
Reported-by Abaci Robot <[email protected]>
Signed-off-by Yang Li <[email protected]>
--- drivers/phy/hisilicon/phy-hisi-inno-usb2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/phy/hisilicon/phy-hisi-inno-usb2.c +3 -1
@@ -146,8 +146,10 @@ static int hisi_inno_phy_probe(struct platform_device *pdev) priv->ports[i].priv = priv; phy =devm_phy_create (dev, child, &hisi_inno_phy_ops); -if (IS_ERR (phy)) +if (IS_ERR (phy)) { +of_node_put (child);return PTR_ERR (phy); + }phy_set_bus_width (phy,8 );phy_set_drvdata (phy, &priv->ports[i]);
Signature · 1 line
1.8.3.1