ice: Fix missing cleanup routine in the case of partial memory allocation
Subsystems (2)
PATCH 1/1 ice: Fix missing cleanup routine in the case of partial memory allocation
Add missing memory free in the case of partial memory allocation in the loop in ice_realloc_zc_buf function.
--- drivers/net/ethernet/intel/ice/ice_xsk.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_xsk.c +9 -1
@@ -377,8 +377,16 @@ int ice_realloc_zc_buf(struct ice_vsi *vsi, bool zc)for_each_set_bit (q, vsi->af_xdp_zc_qps,max_t (int, vsi->alloc_txq, vsi->alloc_rxq)) { rx_ring = vsi->rx_rings[q]; -if (ice_realloc_rx_xdp_bufs (rx_ring, zc)) +if (ice_realloc_rx_xdp_bufs (rx_ring, zc)) { +unsigned long qid = q; + +for_each_set_bit (q, vsi->af_xdp_zc_qps, qid) { + rx_ring = vsi->rx_rings[q]; + zc ?kfree (rx_ring->xdp_buf) : +kfree (rx_ring->rx_buf); + }return -ENOMEM ; + } }return 0 ;
Signature · 6 lines
2.36.1 _______________________________________________ Intel-wired-lan mailing list [email protected] https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
Quoted 14 lines
-----Original Message-----
From: Intel-wired-lan <[email protected]> On Behalf Of Martyna Szapar-Mudlaw
Sent: 13 February 2023 16:10
To: [email protected]
Cc: Martyna Szapar-Mudlaw <[email protected]>
Subject: [Intel-wired-lan] [PATCH net] ice: Fix missing cleanup routine in the case of partial memory allocationAdd missing memory free in the case of partial memory allocation in the loop in
ice_realloc_zc_buffunction.
Quoted 8 lines
Fixes 7e753eb675f0 ("ice: Fix DMA mappings leak")Signed-off-by Martyna Szapar-Mudlaw <martyna.szapar-Reviewed-by Maciej Fijalkowski <[email protected]>---
drivers/net/ethernet/intel/ice/ice_xsk.c| 10 +++++++++-1 file changed, 9 insertions(+), 1 deletion(-)
_______________________________________________
Intel-wired-lan mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan