Patch "igb: Fix potential memory leak in igb_add_ethtool_nfc_entry" has been added to the 5.15-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

    igb: Fix potential memory leak in igb_add_ethtool_nfc_entry

to the 5.15-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:
     igb-fix-potential-memory-leak-in-igb_add_ethtool_nfc.patch
and it can be found in the queue-5.15 subdirectory.

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



commit d02ece7a96d6c81c70db377549b6725f31c6f697
Author: Mateusz Palczewski <mateusz.palczewski@xxxxxxxxx>
Date:   Thu Oct 19 13:40:35 2023 -0700

    igb: Fix potential memory leak in igb_add_ethtool_nfc_entry
    
    [ Upstream commit 8c0b48e01daba5ca58f939a8425855d3f4f2ed14 ]
    
    Add check for return of igb_update_ethtool_nfc_entry so that in case
    of any potential errors the memory alocated for input will be freed.
    
    Fixes: 0e71def25281 ("igb: add support of RX network flow classification")
    Reviewed-by: Wojciech Drewek <wojciech.drewek@xxxxxxxxx>
    Signed-off-by: Mateusz Palczewski <mateusz.palczewski@xxxxxxxxx>
    Tested-by: Arpana Arland <arpanax.arland@xxxxxxxxx> (A Contingent worker at Intel)
    Signed-off-by: Jacob Keller <jacob.e.keller@xxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index b2f46004a3d0f..39c7bdf8c0e2d 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -2974,11 +2974,15 @@ static int igb_add_ethtool_nfc_entry(struct igb_adapter *adapter,
 	if (err)
 		goto err_out_w_lock;
 
-	igb_update_ethtool_nfc_entry(adapter, input, input->sw_idx);
+	err = igb_update_ethtool_nfc_entry(adapter, input, input->sw_idx);
+	if (err)
+		goto err_out_input_filter;
 
 	spin_unlock(&adapter->nfc_lock);
 	return 0;
 
+err_out_input_filter:
+	igb_erase_filter(adapter, input);
 err_out_w_lock:
 	spin_unlock(&adapter->nfc_lock);
 err_out:



[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