diff options
author | Luca Tettamanti <kronos.it@gmail.com> | 2010-09-22 06:41:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-22 16:52:45 -0400 |
commit | ec5a32f67c603b11d68eb283d94eb89a4f6cfce1 (patch) | |
tree | 5f7d7f48f40bf998390da7da43ef40dddfb3d933 /drivers | |
parent | 56b49f4b8f6728b91d10c556c116175051b77b60 (diff) |
atl1: fix resume
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).
Cc: stable@kernel.org
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/atlx/atl1.c | 5 |
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) | |||
2847 | pci_enable_wake(pdev, PCI_D3cold, 0); | 2847 | pci_enable_wake(pdev, PCI_D3cold, 0); |
2848 | 2848 | ||
2849 | atl1_reset_hw(&adapter->hw); | 2849 | atl1_reset_hw(&adapter->hw); |
2850 | adapter->cmb.cmb->int_stats = 0; | ||
2851 | 2850 | ||
2852 | if (netif_running(netdev)) | 2851 | if (netif_running(netdev)) { |
2852 | adapter->cmb.cmb->int_stats = 0; | ||
2853 | atl1_up(adapter); | 2853 | atl1_up(adapter); |
2854 | } | ||
2854 | netif_device_attach(netdev); | 2855 | netif_device_attach(netdev); |
2855 | 2856 | ||
2856 | return 0; | 2857 | return 0; |