Patchwork [1/9] myri10ge: ensure tx queues remain stopped

login
register
mail settings
Submitter Jon Mason
Date June 27, 2011, 3:05 p.m.
Message ID <1309187108-12715-1-git-send-email-mason@myri.com>
Download mbox | patch
Permalink /patch/102190/
State Accepted
Delegated to: David Miller
Headers show

Comments

Jon Mason - June 27, 2011, 3:05 p.m.
Ensure that our tx queues remain stopped when we stop them in
myri10ge_close().  Not doing so can potentially lead to traffic being
transmitted when the interface is removed, which can lead to NULL
pointer dereferences.

Signed-off-by: Jon Mason <mason@myri.com>
---
 drivers/net/myri10ge/myri10ge.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
David Miller - June 29, 2011, 1:02 p.m.
From: Jon Mason <mason@myri.com>
Date: Mon, 27 Jun 2011 10:05:00 -0500

> Ensure that our tx queues remain stopped when we stop them in
> myri10ge_close().  Not doing so can potentially lead to traffic being
> transmitted when the interface is removed, which can lead to NULL
> pointer dereferences.
> 
> Signed-off-by: Jon Mason <mason@myri.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/net/myri10ge/myri10ge.c b/drivers/net/myri10ge/myri10ge.c
index 3ed5f35..a8ae641 100644
--- a/drivers/net/myri10ge/myri10ge.c
+++ b/drivers/net/myri10ge/myri10ge.c
@@ -1461,7 +1461,8 @@  myri10ge_tx_done(struct myri10ge_slice_state *ss, int mcp_index)
 
 	/* start the queue if we've stopped it */
 	if (netif_tx_queue_stopped(dev_queue) &&
-	    tx->req - tx->done < (tx->mask >> 1)) {
+	    tx->req - tx->done < (tx->mask >> 1) &&
+	    ss->mgp->running == MYRI10GE_ETH_RUNNING) {
 		tx->wake_queue++;
 		netif_tx_wake_queue(dev_queue);
 	}