Skip to content

Commit c99abb4

Browse files
Shannon NelsonJeff Kirsher
authored andcommitted
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 <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent de03d2b commit c99abb4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/net/ethernet/intel/i40e/i40e_main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11306,8 +11306,10 @@ static void i40e_remove(struct pci_dev *pdev)
1130611306
/* no more scheduling of any task */
1130711307
set_bit(__I40E_SUSPENDED, &pf->state);
1130811308
set_bit(__I40E_DOWN, &pf->state);
11309-
del_timer_sync(&pf->service_timer);
11310-
cancel_work_sync(&pf->service_task);
11309+
if (pf->service_timer.data)
11310+
del_timer_sync(&pf->service_timer);
11311+
if (pf->service_task.func)
11312+
cancel_work_sync(&pf->service_task);
1131111313

1131211314
if (pf->flags & I40E_FLAG_SRIOV_ENABLED) {
1131311315
i40e_free_vfs(pf);

0 commit comments

Comments
 (0)