From: Ed Cashin Date: Thu, 25 Oct 2012 01:15:21 +0000 (+1100) Subject: aoe: avoid using skb member after dev_queue_xmit X-Git-Tag: next-20121031~1^2~10 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=18598bdf6a59b6eaba9fec46d98c2f4f235fd20d;p=karo-tx-linux.git aoe: avoid using skb member after dev_queue_xmit After calling dev_queue_xmit it is no longer safe to access the members of the skb. Signed-off-by: Ed Cashin Reported-by: Dan Carpenter Signed-off-by: Andrew Morton --- diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c index 3cf068b74b77..24eca2bf9416 100644 --- a/drivers/block/aoe/aoenet.c +++ b/drivers/block/aoe/aoenet.c @@ -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); }