Patch "net: phy: xgmiitorgmii: Fix refcount leak in xgmiitorgmii_probe" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    net: phy: xgmiitorgmii: Fix refcount leak in xgmiitorgmii_probe

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     net-phy-xgmiitorgmii-fix-refcount-leak-in-xgmiitorgm.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit b3cec34c25dd6e26eb88b121ad678d0c1df2bd42
Author: Miaoqian Lin <linmq006@xxxxxxxxx>
Date:   Thu Dec 29 10:29:25 2022 +0400

    net: phy: xgmiitorgmii: Fix refcount leak in xgmiitorgmii_probe
    
    [ Upstream commit d039535850ee47079d59527e96be18d8e0daa84b ]
    
    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@xxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/phy/xilinx_gmii2rgmii.c b/drivers/net/phy/xilinx_gmii2rgmii.c
index 151c2a3f0b3a..7a78dfdfa5bd 100644
--- a/drivers/net/phy/xilinx_gmii2rgmii.c
+++ b/drivers/net/phy/xilinx_gmii2rgmii.c
@@ -82,6 +82,7 @@ static int xgmiitorgmii_probe(struct mdio_device *mdiodev)
 
 	if (!priv->phy_dev->drv) {
 		dev_info(dev, "Attached phy not ready\n");
+		put_device(&priv->phy_dev->mdio.dev);
 		return -EPROBE_DEFER;
 	}
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux