Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1526185 > unrolled thread
| Started by | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| First post | 2016-11-20 09:50 +0100 |
| Last post | 2016-11-20 09:50 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH net 17/18] net/ena: fix NULL dereference when removing the driver after device reset faild Netanel Belgazal <netanel@annapurnalabs.com> - 2016-11-20 09:50 +0100
| From | Netanel Belgazal <netanel@annapurnalabs.com> |
|---|---|
| Date | 2016-11-20 09:50 +0100 |
| Subject | [PATCH net 17/18] net/ena: fix NULL dereference when removing the driver after device reset faild |
| Message-ID | <sFvZ0-dB-9@gated-at.bofh.it> |
If for some reason the device stop responding and the device reset failed to recover the device, the mmio register read datastructure will not be reinitialized. On driver removal, the driver will also tries to reset the device but this time the mmio data structure will be NULL. To solve this issue perform the device reset in the remove function only if the device is runnig. Signed-off-by: Netanel Belgazal <netanel@annapurnalabs.com> --- drivers/net/ethernet/amazon/ena/ena_netdev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c index ba395aa..12d1dca 100644 --- a/drivers/net/ethernet/amazon/ena/ena_netdev.c +++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c @@ -2591,6 +2591,8 @@ static void ena_fw_reset_device(struct work_struct *work) err: rtnl_unlock(); + clear_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags); + dev_err(&pdev->dev, "Reset attempt failed. Can not reset the device\n"); } @@ -3251,7 +3253,9 @@ static void ena_remove(struct pci_dev *pdev) cancel_work_sync(&adapter->resume_io_task); - ena_com_dev_reset(ena_dev); + /* Reset the device only if the device is running. */ + if (test_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags)) + ena_com_dev_reset(ena_dev); ena_free_mgmnt_irq(adapter); -- 1.9.1
Back to top | Article view | linux.kernel
csiph-web