summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/amazon/ena/ena_netdev.c
diff options
context:
space:
mode:
authorArthur Kiyanovski2018-10-09 10:21:28 +0200
committerDavid S. Miller2018-10-09 19:49:49 +0200
commitd7703ddbd7c9cb1ab7c08e1b85b314ff8cea38e9 (patch)
tree20f93958afcfac57f143f74409dbaf671e841f9d /drivers/net/ethernet/amazon/ena/ena_netdev.c
parentnet: ena: fix warning in rmmod caused by double iounmap (diff)
downloadkernel-qcow2-linux-d7703ddbd7c9cb1ab7c08e1b85b314ff8cea38e9.tar.gz
kernel-qcow2-linux-d7703ddbd7c9cb1ab7c08e1b85b314ff8cea38e9.tar.xz
kernel-qcow2-linux-d7703ddbd7c9cb1ab7c08e1b85b314ff8cea38e9.zip
net: ena: fix rare bug when failed restart/resume is followed by driver removal
In a rare scenario when ena_device_restore() fails, followed by device remove, an FLR will not be issued. In this case, the device will keep sending asynchronous AENQ keep-alive events, even after driver removal, leading to memory corruption. Fixes: 8c5c7abdeb2d ("net: ena: add power management ops to the ENA driver") Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/amazon/ena/ena_netdev.c')
-rw-r--r--drivers/net/ethernet/amazon/ena/ena_netdev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 78d84ca0a378..ce18e07ff5ad 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -2619,7 +2619,11 @@ err_disable_msix:
ena_free_mgmnt_irq(adapter);
ena_disable_msix(adapter);
err_device_destroy:
+ ena_com_abort_admin_commands(ena_dev);
+ ena_com_wait_for_abort_completion(ena_dev);
ena_com_admin_destroy(ena_dev);
+ ena_com_mmio_reg_read_request_destroy(ena_dev);
+ ena_com_dev_reset(ena_dev, ENA_REGS_RESET_DRIVER_INVALID_STATE);
err:
clear_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags);
clear_bit(ENA_FLAG_ONGOING_RESET, &adapter->flags);