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

net: phy: xgmiitorgmii: Fix refcount leak in xgmiitorgmii_probe

of_phy_find_device() return device node with refcount incremented.
Call put_device() to relese it when not needed anymore.

Fixes: ab4e6ee578e8 ("net: phy: xgmiitorgmii: Check phy_driver ready before accessing")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Miaoqian Lin and committed by
David S. Miller
d0395358 72f299b0

+1
+1
drivers/net/phy/xilinx_gmii2rgmii.c
··· 105 105 106 106 if (!priv->phy_dev->drv) { 107 107 dev_info(dev, "Attached phy not ready\n"); 108 + put_device(&priv->phy_dev->mdio.dev); 108 109 return -EPROBE_DEFER; 109 110 } 110 111