소스 검색

net: phy: Add missing of_node_put() in xgmiitorgmii_probe()

This node pointer is returned by of_parse_phandle() with
refcount incremented in this function. of_node_put() on it
before exitting this function.

This is detected by Coccinelle semantic patch.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Reviewed-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Wei Yongjun 9 년 전
부모
커밋
4d55d014c5
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      drivers/net/phy/xilinx_gmii2rgmii.c

+ 1 - 0
drivers/net/phy/xilinx_gmii2rgmii.c

@@ -75,6 +75,7 @@ int xgmiitorgmii_probe(struct mdio_device *mdiodev)
 	}
 
 	priv->phy_dev = of_phy_find_device(phy_node);
+	of_node_put(phy_node);
 	if (!priv->phy_dev) {
 		dev_info(dev, "Couldn't find phydev\n");
 		return -EPROBE_DEFER;