iavf: Fix deadlock in iavf_reset_task
authorSlawomir Laba <slawomirx.laba@intel.com>
Wed, 23 Feb 2022 12:38:31 +0000 (13:38 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:12:47 +0000 (19:12 +0100)
commit e85ff9c631e1bf109ce8428848dfc8e8b0041f48 upstream.

There exists a missing mutex_unlock call on crit_lock in
iavf_reset_task call path.

Unlock the crit_lock before returning from reset task.

Fixes: 5ac49f3c2702 ("iavf: use mutexes for locking of critical sections")
Signed-off-by: Slawomir Laba <slawomirx.laba@intel.com>
Signed-off-by: Phani Burra <phani.r.burra@intel.com>
Signed-off-by: Jacob Keller <jacob.e.keller@intel.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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/iavf/iavf_main.c

index 211bd36a834a04e2e8dd74dd9d555bc4152e994c..62f66f9aa7228ae9d952064159c010ac45bed1d6 100644 (file)
@@ -2206,6 +2206,7 @@ static void iavf_reset_task(struct work_struct *work)
                        reg_val);
                iavf_disable_vf(adapter);
                mutex_unlock(&adapter->client_lock);
+               mutex_unlock(&adapter->crit_lock);
                return; /* Do not attempt to reinit. It's dead, Jim. */
        }