1 From ec5a32f67c603b11d68eb283d94eb89a4f6cfce1 Mon Sep 17 00:00:00 2001
2 From: Luca Tettamanti <kronos.it@gmail.com>
3 Date: Wed, 22 Sep 2010 10:41:58 +0000
4 Subject: atl1: fix resume
6 From: Luca Tettamanti <kronos.it@gmail.com>
8 commit ec5a32f67c603b11d68eb283d94eb89a4f6cfce1 upstream.
10 adapter->cmb.cmb is initialized when the device is opened and freed when
11 it's closed. Accessing it unconditionally during resume results either
12 in a crash (NULL pointer dereference, when the interface has not been
13 opened yet) or data corruption (when the interface has been used and
14 brought down adapter->cmb.cmb points to a deallocated memory area).
16 Signed-off-by: Luca Tettamanti <kronos.it@gmail.com>
17 Acked-by: Chris Snook <chris.snook@gmail.com>
18 Signed-off-by: David S. Miller <davem@davemloft.net>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
22 drivers/net/atlx/atl1.c | 5 +++--
23 1 file changed, 3 insertions(+), 2 deletions(-)
25 --- a/drivers/net/atlx/atl1.c
26 +++ b/drivers/net/atlx/atl1.c
27 @@ -2847,10 +2847,11 @@ static int atl1_resume(struct pci_dev *p
28 pci_enable_wake(pdev, PCI_D3cold, 0);
30 atl1_reset_hw(&adapter->hw);
31 - adapter->cmb.cmb->int_stats = 0;
33 - if (netif_running(netdev))
34 + if (netif_running(netdev)) {
35 + adapter->cmb.cmb->int_stats = 0;
38 netif_device_attach(netdev);