netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florin Malita <fmalita@gmail.com>
To: linas@austin.ibm.com
Cc: cbe-oss-dev@ozlabs.org, netdev@vger.kernel.org
Subject: [PATCH] spidernet: skb used after netif_receive_skb
Date: Wed, 16 May 2007 21:39:31 -0400	[thread overview]
Message-ID: <464BB253.7080406@gmail.com> (raw)

The stats update code in spider_net_pass_skb_up() is touching the skb 
after it's been passed up to the stack. To avoid that, just update the 
stats first.


Signed-off-by: Florin Malita <fmalita@gmail.com>
---

 spider_net.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index 108adbf..1df2f0b 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -1013,12 +1013,12 @@ spider_net_pass_skb_up(struct spider_net_descr *descr,
 		 */
 	}
 
-	/* pass skb up to stack */
-	netif_receive_skb(skb);
-
 	/* update netdevice statistics */
 	card->netdev_stats.rx_packets++;
 	card->netdev_stats.rx_bytes += skb->len;
+
+	/* pass skb up to stack */
+	netif_receive_skb(skb);
 }
 
 #ifdef DEBUG


                 reply	other threads:[~2007-05-17  1:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=464BB253.7080406@gmail.com \
    --to=fmalita@gmail.com \
    --cc=cbe-oss-dev@ozlabs.org \
    --cc=linas@austin.ibm.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).