mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
octeon_ep: cancel tx_timeout_task later in remove sequence
[ Upstream commit28458c8000] tx_timeout_task is canceled too early when removing the driver. Nothing prevents .ndo_tx_timeout from triggering and queuing the work again. Better cancel it after the netdev is unregistered. It's harmless for octep_tx_timeout_task to run in the window between the unregistration and cancelation, because it checks netif_running. Fixes:862cd659a6("octeon_ep: Add driver framework and device initialization") Signed-off-by: Michal Schmidt <mschmidt@redhat.com> Link: https://lore.kernel.org/r/20230810150114.107765-3-mschmidt@redhat.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
58a54bad3a
commit
75c724e2b7
@@ -1121,12 +1121,12 @@ static void octep_remove(struct pci_dev *pdev)
|
|||||||
if (!oct)
|
if (!oct)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
cancel_work_sync(&oct->tx_timeout_task);
|
|
||||||
cancel_work_sync(&oct->ctrl_mbox_task);
|
cancel_work_sync(&oct->ctrl_mbox_task);
|
||||||
netdev = oct->netdev;
|
netdev = oct->netdev;
|
||||||
if (netdev->reg_state == NETREG_REGISTERED)
|
if (netdev->reg_state == NETREG_REGISTERED)
|
||||||
unregister_netdev(netdev);
|
unregister_netdev(netdev);
|
||||||
|
|
||||||
|
cancel_work_sync(&oct->tx_timeout_task);
|
||||||
octep_device_cleanup(oct);
|
octep_device_cleanup(oct);
|
||||||
pci_release_mem_regions(pdev);
|
pci_release_mem_regions(pdev);
|
||||||
free_netdev(netdev);
|
free_netdev(netdev);
|
||||||
|
|||||||
Reference in New Issue
Block a user