Skip to content

Commit 2ca3034

Browse files
lgs2513gregkh
authored andcommitted
ice: fix double free in ice_sf_eth_activate() error path
commit 9aab1c3 upstream. When auxiliary_device_add() fails, ice_sf_eth_activate() jumps to aux_dev_uninit and calls auxiliary_device_uninit(&sf_dev->adev). The device release callback ice_sf_dev_release() frees sf_dev, but the current error path falls through to sf_dev_free and calls kfree(sf_dev) again, causing a double free. Keep kfree(sf_dev) for the auxiliary_device_init() failure path, but avoid falling through to sf_dev_free after auxiliary_device_uninit(). Fixes: 13acc5c ("ice: subfunction activation and base devlink ops") Cc: stable@vger.kernel.org Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20260416-iwl-net-submission-2026-04-14-v2-3-686c33c9828d@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent db8012c commit 2ca3034

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/net/ethernet/intel/ice/ice_sf_eth.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ ice_sf_eth_activate(struct ice_dynamic_port *dyn_port,
305305

306306
aux_dev_uninit:
307307
auxiliary_device_uninit(&sf_dev->adev);
308+
return err;
309+
308310
sf_dev_free:
309311
kfree(sf_dev);
310312
xa_erase:

0 commit comments

Comments
 (0)