ice: Cleanup fltr list in case of allocation issues
authorRobert Malz <robertx.malz@intel.com>
Fri, 26 Feb 2021 21:19:32 +0000 (13:19 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Apr 2021 06:42:00 +0000 (08:42 +0200)
commite5386e87f8aa318ef8c2e9baaead82a2b40f1e2f
tree1391a0d83ddcb5c25c2ae0d58e491f50f3f00e67
parent9d1c342c5018ff5e7cbe1fc7d82e9b4e4d8afea8
ice: Cleanup fltr list in case of allocation issues

commit b7eeb52721fe417730fc5adc5cbeeb5fe349ab26 upstream.

When ice_remove_vsi_lkup_fltr is called, by calling
ice_add_to_vsi_fltr_list local copy of vsi filter list
is created. If any issues during creation of vsi filter
list occurs it up for the caller to free already
allocated memory. This patch ensures proper memory
deallocation in these cases.

Fixes: 80d144c9ac82 ("ice: Refactor switch rule management structures and functions")
Signed-off-by: Robert Malz <robertx.malz@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/ice/ice_switch.c