summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Tettamanti <kronos.it@gmail.com>2010-09-22 10:41:58 +0000
committerGreg Kroah-Hartman <gregkh@suse.de>2010-10-28 21:51:27 -0700
commit6c4a46eccf8cb90c312ba93bccccb6857d07df80 (patch)
tree04ae253ca6a7f1c42b02b64156b3c0b92c29cf51
parent7ca9783455c1226bcecd1e543b50e6cc38994535 (diff)
atl1: fix resume
commit ec5a32f67c603b11d68eb283d94eb89a4f6cfce1 upstream. adapter->cmb.cmb is initialized when the device is opened and freed when it's closed. Accessing it unconditionally during resume results either in a crash (NULL pointer dereference, when the interface has not been opened yet) or data corruption (when the interface has been used and brought down adapter->cmb.cmb points to a deallocated memory area). Signed-off-by: Luca Tettamanti <kronos.it@gmail.com> Acked-by: Chris Snook <chris.snook@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/net/atlx/atl1.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 63b9ba0cc67e..bbd6e3009be0 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -2847,10 +2847,11 @@ static int atl1_resume(struct pci_dev *pdev)
pci_enable_wake(pdev, PCI_D3cold, 0);
atl1_reset_hw(&adapter->hw);
- adapter->cmb.cmb->int_stats = 0;
- if (netif_running(netdev))
+ if (netif_running(netdev)) {
+ adapter->cmb.cmb->int_stats = 0;
atl1_up(adapter);
+ }
netif_device_attach(netdev);
return 0;