ena module for Driver Update Program
CentOS Sources
2019-01-09 fc384122a7a805dde4dbbf3c4c4ef94a5ca0f2fe
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Date: Mon, 26 Nov 2018 09:50:11 -0500
From: linville@redhat.com
To: rhkernel-list@redhat.com
Subject: [RHEL7 29/31] net: ena: fix crash during failed resume from
 hibernation
 
From: "John W. Linville" <linville@redhat.com>
 
BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1633418
Brew: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=19216936
 
During resume from hibernation if ena_restore_device fails,
ena_com_dev_reset() is called, and uses the readless read mechanism,
which was already destroyed by the call to
ena_com_mmio_reg_read_request_destroy(). This causes a NULL pointer
reference.
 
In this commit we switch the call order of the above two functions
to avoid this crash.
 
Fixes: d7703ddbd7c9 ("net: ena: fix rare bug when failed restart/resume is followed by driver removal")
Signed-off-by: Arthur Kiyanovski <akiyano@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e76ad21d070f79e566ac46ce0b0584c3c93e1b43)
Signed-off-by: John W. Linville <linville@redhat.com>
---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index b095c4e05b15..7be3a5695897 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -2688,8 +2688,8 @@ 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);
+    ena_com_mmio_reg_read_request_destroy(ena_dev);
 err:
     clear_bit(ENA_FLAG_DEVICE_RUNNING, &adapter->flags);
     clear_bit(ENA_FLAG_ONGOING_RESET, &adapter->flags);
-- 
2.17.2