Patch "net: hns3: release PTP resources if pf initialization failed" has been added to the 6.1-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: hns3: release PTP resources if pf initialization failed

to the 6.1-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-hns3-release-ptp-resources-if-pf-initialization-.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 335e8a81f7972be0aebdeab087478948db293273
Author: Peiyang Wang <wangpeiyang1@xxxxxxxxxx>
Date:   Tue May 7 21:42:21 2024 +0800

    net: hns3: release PTP resources if pf initialization failed
    
    [ Upstream commit 950aa42399893a170d9b57eda0e4a3ff91fd8b70 ]
    
    During the PF initialization process, hclge_update_port_info may return an
    error code for some reason. At this point,  the ptp initialization has been
    completed. To void memory leaks, the resources that are applied by ptp
    should be released. Therefore, when hclge_update_port_info returns an error
    code, hclge_ptp_uninit is called to release the corresponding resources.
    
    Fixes: eaf83ae59e18 ("net: hns3: add querying fec ability from firmware")
    Signed-off-by: Peiyang Wang <wangpeiyang1@xxxxxxxxxx>
    Signed-off-by: Jijie Shao <shaojijie@xxxxxxxxxx>
    Reviewed-by: Hariprasad Kelam <hkelam@xxxxxxxxxxx>
    Signed-off-by: Paolo Abeni <pabeni@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
index 19a0b6c37c909..75472fde78f17 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
@@ -11742,7 +11742,7 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
 
 	ret = hclge_update_port_info(hdev);
 	if (ret)
-		goto err_mdiobus_unreg;
+		goto err_ptp_uninit;
 
 	INIT_KFIFO(hdev->mac_tnl_log);
 
@@ -11788,6 +11788,8 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev)
 	devl_unlock(hdev->devlink);
 	return 0;
 
+err_ptp_uninit:
+	hclge_ptp_uninit(hdev);
 err_mdiobus_unreg:
 	if (hdev->hw.mac.phydev)
 		mdiobus_unregister(hdev->hw.mac.mdio_bus);




[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