]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
aoe: avoid using skb member after dev_queue_xmit
authorEd Cashin <ecashin@coraid.com>
Sat, 3 Nov 2012 00:43:09 +0000 (11:43 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 7 Nov 2012 04:15:36 +0000 (15:15 +1100)
After calling dev_queue_xmit it is no longer safe to access the
members of the skb.

Signed-off-by: Ed Cashin <ecashin@coraid.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/aoe/aoenet.c

index 3cf068b74b77f00e4f6efd2ef042f0295d31aaf7..24eca2bf94165820f4255980e7474e3f3fdef9fe 100644 (file)
@@ -55,12 +55,14 @@ static int
 tx(void) __must_hold(&txlock)
 {
        struct sk_buff *skb;
+       struct net_device *ifp;
 
        while ((skb = skb_dequeue(&skbtxq))) {
                spin_unlock_irq(&txlock);
+               ifp = skb->dev;
                if (dev_queue_xmit(skb) == NET_XMIT_DROP && net_ratelimit())
                        pr_warn("aoe: packet could not be sent on %s.  %s\n",
-                               skb->dev ? skb->dev->name : "netif",
+                               ifp ? ifp->name : "netif",
                                "consider increasing tx_queue_len");
                spin_lock_irq(&txlock);
        }