aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDinghao Liu <dinghao.liu@zju.edu.cn>2021-01-03 16:08:42 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-30 14:31:48 +0200
commit028210541b3c2b6c81ddc893b6cd54a68bbb23fc (patch)
treee586da9016299569bcd0050f8641d85762c4f352
parent4dc123500c3bcdb834a3685bc412bf7e2813ea3f (diff)
downloadkernel_replicant_linux-028210541b3c2b6c81ddc893b6cd54a68bbb23fc.tar.gz
kernel_replicant_linux-028210541b3c2b6c81ddc893b6cd54a68bbb23fc.tar.bz2
kernel_replicant_linux-028210541b3c2b6c81ddc893b6cd54a68bbb23fc.zip
ixgbe: Fix memleak in ixgbe_configure_clsu32
[ Upstream commit 7a766381634da19fc837619b0a34590498d9d29a ] When ixgbe_fdir_write_perfect_filter_82599() fails, input allocated by kzalloc() has not been freed, which leads to memleak. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de> Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index f3f449f53920..278fc866fad4 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -9582,8 +9582,10 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,
ixgbe_atr_compute_perfect_hash_82599(&input->filter, mask);
err = ixgbe_fdir_write_perfect_filter_82599(hw, &input->filter,
input->sw_idx, queue);
- if (!err)
- ixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx);
+ if (err)
+ goto err_out_w_lock;
+
+ ixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx);
spin_unlock(&adapter->fdir_perfect_lock);
if ((uhtid != 0x800) && (adapter->jump_tables[uhtid]))