igb: Fix potential memory leak in igb_add_ethtool_nfc_entry
Subsystems (2)
PATCH 1/1 igb: Fix potential memory leak in igb_add_ethtool_nfc_entry
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.
--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/igb/igb_ethtool.c +5 -1
@@ -2978,11 +2978,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:
Signature · 6 lines
2.31.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 7 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Mateusz Palczewski
Sent: Wednesday, October 4, 2023 3:55 PM
To: [email protected]
Cc: Palczewski, Mateusz <[email protected]>; Drewek, Wojciech <[email protected]>
Subject: [Intel-wired-lan] [PATCH iwl-net v1] igb: Fix potential memory leak inigb_add_ethtool_nfc_entry
Quoted 9 lines
Add check for return of
igb_update_ethtool_nfc_entryso 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 <[email protected]>Signed-off-by Mateusz Palczewski <[email protected]>--- drivers/net/ethernet/intel/igb/igb_ethtool.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan