All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Tettamanti <kronos.it@gmail.com>
To: netdev@vger.kernel.org
Cc: atl1-devel@lists.sourceforge.net, jcliburn@gmail.com,
	chris.snook@gmail.com, jie.yang@atheros.com
Subject: [PATCH 1/2] atl1: fix resume
Date: Wed, 22 Sep 2010 22:41:58 +0200	[thread overview]
Message-ID: <20100922204158.GA1372@nb-core2.darkstar.lan> (raw)
In-Reply-To: <20100922.132341.48506736.davem@davemloft.net>

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>
---
This time with mutt :)

 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 63b9ba0..bbd6e30 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;
-- 
1.7.1

  reply	other threads:[~2010-09-22 20:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-11 13:12 [BUG] atl1 causes lockup/reboot on resume from STR Luca Tettamanti
2010-09-11 20:47 ` Jarek Poplawski
2010-09-14 13:59   ` Luca Tettamanti
2010-09-14 14:22 ` Luca Tettamanti
2010-09-16 19:29   ` Luca Tettamanti
2010-09-16 19:29   ` [PATCH 1/2] atl1: fix resume Luca Tettamanti
2010-09-16 20:13     ` Chris Snook
2010-09-16 21:13     ` [stable] " Greg KH
2010-09-17  4:47       ` David Miller
2010-09-16 19:29   ` [PATCH 2/2] atl1: zero out CMB and SBM in atl1_free_ring_resources Luca Tettamanti
2010-09-16 20:15     ` Chris Snook
     [not found]   ` <1284717403-12913-1-git-send-email-kronos.it@gmail.com>
2010-09-22 19:34     ` [PATCH 1/2] atl1: fix resume Luca Tettamanti
2010-09-22 20:23       ` David Miller
2010-09-22 20:41         ` Luca Tettamanti [this message]
2010-09-22 20:53           ` David Miller
2010-09-22 20:42         ` [PATCH 2/2] atl1: zero out CMB and SBM in atl1_free_ring_resources Luca Tettamanti
2010-09-22 20:53           ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100922204158.GA1372@nb-core2.darkstar.lan \
    --to=kronos.it@gmail.com \
    --cc=atl1-devel@lists.sourceforge.net \
    --cc=chris.snook@gmail.com \
    --cc=jcliburn@gmail.com \
    --cc=jie.yang@atheros.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.