Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161044Ab2JXS1H (ORCPT ); Wed, 24 Oct 2012 14:27:07 -0400 Received: from dupo.coraid.com ([208.71.232.133]:52307 "EHLO coraid.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935245Ab2JXS1F (ORCPT ); Wed, 24 Oct 2012 14:27:05 -0400 From: Ed Cashin Subject: [PATCH] aoe: avoid using skb member after dev_queue_xmit To: akpm@linux-foundation.org Cc: ecashin@coraid.com, dan.carpenter@oracle.com, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org From: Ed Cashin X-Mailer: nedmail Date: Wed, 24 Oct 2012 14:26:13 -0400 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1175 Lines: 37 After calling dev_queue_xmit it is no longer safe to access the members of the skb. Reported-by: Dan Carpenter Signed-off-by: Ed Cashin --- drivers/block/aoe/aoenet.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/block/aoe/aoenet.c b/drivers/block/aoe/aoenet.c index ae56828..2e47404 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); } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/