[PKTGEN]: Fix multiqueue oops.
authorRobert Olsson <robert.olsson@its.uu.se>
Tue, 28 Aug 2007 22:43:14 +0000 (15:43 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Aug 2007 22:43:14 +0000 (15:43 -0700)
Initially pkt_dev can be NULL this causes netif_subqueue_stopped to
oops. The patch below should cure it. But maybe the pktgen TX logic
should be reworked to better support the new multiqueue support.

Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/pktgen.c

index 7bae576ac115bf19732d878ac7022d5baeb1f0ab..4ad62d375373a550399e44daa7ecfd780be038d4 100644 (file)
@@ -3331,8 +3331,9 @@ static __inline__ void pktgen_xmit(struct pktgen_dev *pkt_dev)
        }
 
        if ((netif_queue_stopped(odev) ||
-            netif_subqueue_stopped(odev, pkt_dev->skb->queue_mapping)) ||
-            need_resched()) {
+            (pkt_dev->skb &&
+             netif_subqueue_stopped(odev, pkt_dev->skb->queue_mapping))) ||
+           need_resched()) {
                idle_start = getCurUs();
 
                if (!netif_running(odev)) {