]> git.itanic.dy.fi Git - linux-stable/commitdiff
ixgbe: Fix memleak in ixgbe_configure_clsu32
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Sun, 3 Jan 2021 08:08:42 +0000 (16:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:40:08 +0000 (14:40 +0200)
[ 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>
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

index 9c3fa0b5555196ecb1a82edafe96ab25bed0d95c..e9205c8935310bd7a4f6191cb5368b799acfbd16 100644 (file)
@@ -9266,8 +9266,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]))