]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
i40e: fix potential memory leaks in i40e_remove()
authorAndrii Staikov <andrii.staikov@intel.com>
Fri, 8 Sep 2023 12:42:01 +0000 (14:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:51:51 +0000 (11:51 +0100)
commit42b452960a13d00b87aa636bc2153b9aa92ccca3
tree7d001db06867c83d68397d75747562fd2d9a2095
parent36f0004fe5bde7dfe4fa568cf9324d659b35705d
i40e: fix potential memory leaks in i40e_remove()

[ Upstream commit 5ca636d927a106780451d957734f02589b972e2b ]

Instead of freeing memory of a single VSI, make sure
the memory for all VSIs is cleared before releasing VSIs.
Add releasing of their resources in a loop with the iteration
number equal to the number of allocated VSIs.

Fixes: 41c445ff0f48 ("i40e: main driver core")
Signed-off-by: Andrii Staikov <andrii.staikov@intel.com>
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
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