i40e: Fix memory leak in i40e_probe
authorKeita Suzuki <keitasuzuki.park@sslab.ics.keio.ac.jp>
Fri, 30 Oct 2020 07:14:30 +0000 (07:14 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Mar 2021 16:06:25 +0000 (17:06 +0100)
commit6c73bc9f28e2709a44efc64256bc757c4ca223fd
treee8c3814a5ff7e505fde2f3ae8ba4d88d9c2b18a6
parent6d4fabc6c7ecbe1f77eb532b6647d06ed16afb4c
i40e: Fix memory leak in i40e_probe

[ Upstream commit 58cab46c622d6324e47bd1c533693c94498e4172 ]

Struct i40e_veb is allocated in function i40e_setup_pf_switch, and
stored to an array field veb inside struct i40e_pf. However when
i40e_setup_misc_vector fails, this memory leaks.

Fix this by calling exit and teardown functions.

Signed-off-by: Keita Suzuki <keitasuzuki.park@sslab.ics.keio.ac.jp>
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/i40e/i40e_main.c