aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2010-01-04 03:48:41 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-12 05:55:24 -0500
commit9db2f1bec36805e57a003f7bb90e003815d96de8 (patch)
tree5293188063fdd95104fd1d4f0f0e5693ca99874a /drivers
parentaa4e2e171385bb77b4da8b760d26dea2aa291587 (diff)
sky2: Fix oops in sky2_xmit_frame() after TX timeout
During TX timeout procedure dev could be awoken too early, e.g. by sky2_complete_tx() called from sky2_down(). Then sky2_xmit_frame() can run while buffers are freed causing an oops. This patch fixes it by adding netif_device_present() test in sky2_tx_complete(). Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=14925 With debugging by: Mike McCormack <mikem@ring3k.org> Reported-by: Berck E. Nash <flyboy@gmail.com> Tested-by: Berck E. Nash <flyboy@gmail.com> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/sky2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 1c01b96c9611..7650f739a81a 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1844,7 +1844,8 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done)
1844 sky2->tx_cons = idx; 1844 sky2->tx_cons = idx;
1845 smp_mb(); 1845 smp_mb();
1846 1846
1847 if (tx_avail(sky2) > MAX_SKB_TX_LE + 4) 1847 /* Wake unless it's detached, and called e.g. from sky2_down() */
1848 if (tx_avail(sky2) > MAX_SKB_TX_LE + 4 && netif_device_present(dev))
1848 netif_wake_queue(dev); 1849 netif_wake_queue(dev);
1849} 1850}
1850 1851