diff options
author | Shannon Nelson <shannon.nelson@intel.com> | 2016-03-10 14:59:45 -0800 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2016-04-05 12:26:09 -0700 |
commit | c99abb4cb8227bf8172c085213c91bf155c6618a (patch) | |
tree | 63676795edddd31e0dba84f6298f7bdbd5743d68 | |
parent | de03d2b0ef6520cf9da2e429cd7afb534782b737 (diff) |
i40e: Remove timer and task only if created
In some error scenarios, we may find ourselves trying to remove a
non-existent timer or worktask. This causes the kernel some bit
of consternation, so don't do it.
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index 56d4416c9a11..e615f66f576f 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -11306,8 +11306,10 @@ static void i40e_remove(struct pci_dev *pdev) /* no more scheduling of any task */ set_bit(__I40E_SUSPENDED, &pf->state); set_bit(__I40E_DOWN, &pf->state); - del_timer_sync(&pf->service_timer); - cancel_work_sync(&pf->service_task); + if (pf->service_timer.data) + del_timer_sync(&pf->service_timer); + if (pf->service_task.func) + cancel_work_sync(&pf->service_task); if (pf->flags & I40E_FLAG_SRIOV_ENABLED) { i40e_free_vfs(pf); |