From: Eric Joyner eric.joyner@intel.com
Memory allocated in the ice_add_prof_id_vsig() function wasn't being properly freed if an error occurred inside the for-loop in the function.
In particular, 'p' wasn't being freed if an error occurred before it was added to the resource list at the end of the for-loop.
CC: stable stable@vger.kernel.org Signed-off-by: Eric Joyner eric.joyner@intel.com Signed-off-by: Tony Nguyen anthony.l.nguyen@intel.com Tested-by: Andrew Bowers andrewx.bowers@intel.com Signed-off-by: Jeff Kirsher jeffrey.t.kirsher@intel.com --- drivers/net/ethernet/intel/ice/ice_flex_pipe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c index 4dc72aef5381..38c37f506257 100644 --- a/drivers/net/ethernet/intel/ice/ice_flex_pipe.c +++ b/drivers/net/ethernet/intel/ice/ice_flex_pipe.c @@ -4228,8 +4228,10 @@ ice_add_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl, t->tcam[i].prof_id, t->tcam[i].ptg, vsig, 0, 0, vl_msk, dc_msk, nm_msk); - if (status) + if (status) { + devm_kfree(ice_hw_to_dev(hw), p); goto err_ice_add_prof_id_vsig; + }
/* log change */ list_add(&p->list_entry, chg);
Hi
[This is an automated email]
This commit has been processed because it contains a -stable tag. The stable tag indicates that it's relevant for the following trees: all
The bot has tested the following trees: v5.6.14, v5.4.42, v4.19.124, v4.14.181, v4.9.224, v4.4.224.
v5.6.14: Build OK! v5.4.42: Failed to apply! Possible dependencies: 31ad4e4ee1e4 ("ice: Allocate flow profile") 451f2c4406e0 ("ice: Populate TCAM filter software structures") c90ed40cefe1 ("ice: Enable writing hardware filtering tables") eff380aaffed ("ice: Introduce ice_base.c")
v4.19.124: Failed to apply! Possible dependencies: 0f9d5027a749 ("ice: Refactor VSI allocation, deletion and rebuild flow") 28c2a6457388 ("ice: Move common functions out of ice_main.c part 4/7") 31ad4e4ee1e4 ("ice: Allocate flow profile") 451f2c4406e0 ("ice: Populate TCAM filter software structures") 45d3d428eafc ("ice: Move common functions out of ice_main.c part 1/7") 4f74dcc1b86d ("ice: Enable VSI Rx/Tx pruning only when VLAN 0 is active") 5153a18e57ff ("ice: Move common functions out of ice_main.c part 3/7") 72adf2421d9b ("ice: Move common functions out of ice_main.c part 2/7") 75d2b253026b ("ice: Add support to detect SR-IOV capability and mailbox queues") 80d144c9ac82 ("ice: Refactor switch rule management structures and functions") 8b97ceb1dc0f ("ice: Enable firmware logging during device initialization.") 995c90f2de81 ("ice: Calculate guaranteed VSIs per function and use it") 9e4ab4c29a62 ("ice: Add support for dynamic interrupt moderation") b3969fd727aa ("ice: Add support for Tx hang, Tx timeout and malicious driver detection") f80eaa421076 ("ice: Clean up register file")
v4.14.181: Failed to apply! Possible dependencies: 31ad4e4ee1e4 ("ice: Allocate flow profile") 3a858ba392c3 ("ice: Add support for VSI allocation and deallocation") 451f2c4406e0 ("ice: Populate TCAM filter software structures") 7ec59eeac804 ("ice: Add support for control queues") 837f08fdecbe ("ice: Add basic driver framework for Intel(R) E800 Series") 940b61af02f4 ("ice: Initialize PF and setup miscellaneous interrupt") 9c20346b6309 ("ice: Get switch config, scheduler config and device capabilities") 9daf8208dd4d ("ice: Add support for switch filter programming") dc49c7723676 ("ice: Get MAC/PHY/link info and scheduler topology") f31e4b6fe227 ("ice: Start hardware initialization")
v4.9.224: Failed to apply! Possible dependencies: 31ad4e4ee1e4 ("ice: Allocate flow profile") 3a858ba392c3 ("ice: Add support for VSI allocation and deallocation") 451f2c4406e0 ("ice: Populate TCAM filter software structures") 7ec59eeac804 ("ice: Add support for control queues") 837f08fdecbe ("ice: Add basic driver framework for Intel(R) E800 Series") 940b61af02f4 ("ice: Initialize PF and setup miscellaneous interrupt") 9c20346b6309 ("ice: Get switch config, scheduler config and device capabilities") 9daf8208dd4d ("ice: Add support for switch filter programming") dc49c7723676 ("ice: Get MAC/PHY/link info and scheduler topology") f31e4b6fe227 ("ice: Start hardware initialization")
v4.4.224: Failed to apply! Possible dependencies: 31ad4e4ee1e4 ("ice: Allocate flow profile") 3a858ba392c3 ("ice: Add support for VSI allocation and deallocation") 451f2c4406e0 ("ice: Populate TCAM filter software structures") 7ec59eeac804 ("ice: Add support for control queues") 837f08fdecbe ("ice: Add basic driver framework for Intel(R) E800 Series") 940b61af02f4 ("ice: Initialize PF and setup miscellaneous interrupt") 9c20346b6309 ("ice: Get switch config, scheduler config and device capabilities") 9daf8208dd4d ("ice: Add support for switch filter programming") dc49c7723676 ("ice: Get MAC/PHY/link info and scheduler topology") f31e4b6fe227 ("ice: Start hardware initialization")
NOTE: The patch will not be queued to stable trees until it is upstream.
How should we proceed with this patch?
linux-stable-mirror@lists.linaro.org