myri10ge: ensure tx queues remain stopped
authorJon Mason <mason@myri.com>
Mon, 27 Jun 2011 05:05:00 +0000 (05:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 29 Jun 2011 13:02:04 +0000 (06:02 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/myri10ge/myri10ge.c

index 3ed5f3505ceab30d0f09d5aad9a878b09840d3ca..a8ae641d0bd1e2506aafb3631e94dce306f7aaac 100644 (file)
@@ -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);
        }