]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.35.8/atl1-fix-resume.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.35.8 / atl1-fix-resume.patch
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
5
6 From: Luca Tettamanti <kronos.it@gmail.com>
7
8 commit ec5a32f67c603b11d68eb283d94eb89a4f6cfce1 upstream.
9
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).
15
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>
20
21 ---
22 drivers/net/atlx/atl1.c | 5 +++--
23 1 file changed, 3 insertions(+), 2 deletions(-)
24
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);
29
30 atl1_reset_hw(&adapter->hw);
31 - adapter->cmb.cmb->int_stats = 0;
32
33 - if (netif_running(netdev))
34 + if (netif_running(netdev)) {
35 + adapter->cmb.cmb->int_stats = 0;
36 atl1_up(adapter);
37 + }
38 netif_device_attach(netdev);
39
40 return 0;