Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=10a273a67343e1f317652d69b09a212ee0284b44
Commit:     10a273a67343e1f317652d69b09a212ee0284b44
Parent:     a6d89915aa668776494fec8568d46aa6043ff848
Author:     Jeremy Fitzhardinge <[EMAIL PROTECTED]>
AuthorDate: Mon Aug 13 12:54:37 2007 -0700
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Tue Aug 14 01:51:09 2007 -0400

    xen-netfront: Avoid deref'ing skbafter it is potentially freed.
    
    xennet_tx_bug_gc can free the skb before we use it, so make sure we don't.
    
    Signed-off-by: Keir Fraser <[EMAIL PROTECTED]>
    Signed-off-by: Jeremy Fitzhardinge <[EMAIL PROTECTED]>
    Cc: Jeff Garzik <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/net/xen-netfront.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 489f69c..4445810 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -566,6 +566,10 @@ static int xennet_start_xmit(struct sk_buff *skb, struct 
net_device *dev)
        if (notify)
                notify_remote_via_irq(np->netdev->irq);
 
+       np->stats.tx_bytes += skb->len;
+       np->stats.tx_packets++;
+
+       /* Note: It is not safe to access skb after xennet_tx_buf_gc()! */
        xennet_tx_buf_gc(dev);
 
        if (!netfront_tx_slot_available(np))
@@ -573,9 +577,6 @@ static int xennet_start_xmit(struct sk_buff *skb, struct 
net_device *dev)
 
        spin_unlock_irq(&np->tx_lock);
 
-       np->stats.tx_bytes += skb->len;
-       np->stats.tx_packets++;
-
        return 0;
 
  drop:
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to