iavf: Fix double free in iavf_reset_task
authorPrzemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Wed, 9 Mar 2022 15:37:39 +0000 (16:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Mar 2022 08:16:42 +0000 (09:16 +0100)
commit735f918cc2c8510583af8f0e4ded48ba6f19c9a4
tree85aa8fefc192babee84e8a344e743f3dbc5f8837
parentb2bc45327e8cbb1adefcf5cbd53c67868428982a
iavf: Fix double free in iavf_reset_task

[ Upstream commit 16b2dd8cdf6f4e0597c34899de74b4d012b78188 ]

Fix double free possibility in iavf_disable_vf, as crit_lock is
freed in caller, iavf_reset_task. Add kernel-doc for iavf_disable_vf.
Remove mutex_unlock in iavf_disable_vf.
Without this patch there is double free scenario, when calling
iavf_reset_task.

Fixes: e85ff9c631e1 ("iavf: Fix deadlock in iavf_reset_task")
Signed-off-by: Przemyslaw Patynowski <przemyslawx.patynowski@intel.com>
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mateusz Palczewski <mateusz.palczewski@intel.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/iavf/iavf_main.c