Patch "net: hinic: Fix cleanup in create_rxqs/txqs()" has been added to the 5.10-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: hinic: Fix cleanup in create_rxqs/txqs()

to the 5.10-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-hinic-fix-cleanup-in-create_rxqs-txqs.patch
and it can be found in the queue-5.10 subdirectory.

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



commit c3edb2281a1f0bdd0b530729dbfa670525f94a7e
Author: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Date:   Fri Dec 13 17:28:11 2024 +0300

    net: hinic: Fix cleanup in create_rxqs/txqs()
    
    [ Upstream commit 7203d10e93b6e6e1d19481ef7907de6a9133a467 ]
    
    There is a check for NULL at the start of create_txqs() and
    create_rxqs() which tess if "nic_dev->txqs" is non-NULL.  The
    intention is that if the device is already open and the queues
    are already created then we don't create them a second time.
    
    However, the bug is that if we have an error in the create_txqs()
    then the pointer doesn't get set back to NULL.  The NULL check
    at the start of the function will say that it's already open when
    it's not and the device can't be used.
    
    Set ->txqs back to NULL on cleanup on error.
    
    Fixes: c3e79baf1b03 ("net-next/hinic: Add logical Txq and Rxq")
    Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Reviewed-by: Simon Horman <horms@xxxxxxxxxx>
    Link: https://patch.msgid.link/0cc98faf-a0ed-4565-a55b-0fa2734bc205@stanley.mountain
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c
index 6ec042d48cd1..dd5c96557976 100644
--- a/drivers/net/ethernet/huawei/hinic/hinic_main.c
+++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c
@@ -173,6 +173,7 @@ static int create_txqs(struct hinic_dev *nic_dev)
 	hinic_sq_dbgfs_uninit(nic_dev);
 
 	devm_kfree(&netdev->dev, nic_dev->txqs);
+	nic_dev->txqs = NULL;
 	return err;
 }
 
@@ -269,6 +270,7 @@ static int create_rxqs(struct hinic_dev *nic_dev)
 	hinic_rq_dbgfs_uninit(nic_dev);
 
 	devm_kfree(&netdev->dev, nic_dev->rxqs);
+	nic_dev->rxqs = NULL;
 	return err;
 }
 




[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