iavf: missing unlocks in iavf_watchdog_task()
authorDan Carpenter <dan.carpenter@oracle.com>
Wed, 10 Nov 2021 08:13:50 +0000 (11:13 +0300)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 13 Dec 2021 17:19:22 +0000 (09:19 -0800)
This code was re-organized and there some unlocks missing now.

Fixes: 898ef1cb1cb2 ("iavf: Combine init and watchdog state machines")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/iavf/iavf_main.c

index cfdbf8c08d18bcd82050dc089705850c640481e4..884a19c515433caedd912fc4492d287463bfff40 100644 (file)
@@ -2046,6 +2046,7 @@ static void iavf_watchdog_task(struct work_struct *work)
                }
                adapter->aq_required = 0;
                adapter->current_op = VIRTCHNL_OP_UNKNOWN;
+               mutex_unlock(&adapter->crit_lock);
                queue_delayed_work(iavf_wq,
                                   &adapter->watchdog_task,
                                   msecs_to_jiffies(10));
@@ -2076,9 +2077,8 @@ static void iavf_watchdog_task(struct work_struct *work)
                        iavf_detect_recover_hung(&adapter->vsi);
                break;
        case __IAVF_REMOVE:
-               mutex_unlock(&adapter->crit_lock);
-               return;
        default:
+               mutex_unlock(&adapter->crit_lock);
                return;
        }