Skip to contentSkip to conversation

eth16i.c: don't reference skb after passing it to netif_rx

PATCH New Arnaldo Carvalho de Melo 1 participant 1 message Feb 27, 2001 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eth16i.c: don't reference skb after passing it to netif_rx

yet another one. 8)

Em Mon, Feb 26, 2001 at 08:33:59PM -0300, Arnaldo Carvalho de Melo escreveu:
Hi,

I've just read davem's post at netdev about the brokeness of
referencing skbs after passing it to netif_rx, so please consider applying this patch. Ah, this was just added to the Janitor's TODO list at
http://bazar.conectiva.com.br/~acme/TODO and I'm doing a quick audit in the net drivers searching for this, maybe some more patches will follow.

- Arnaldo

drivers/net/eth16i.c +4 -4
@@ -1195,10 +1195,6 @@
 			}
 
 			skb->protocol=eth_type_trans(skb, dev);
-			netif_rx(skb);
-			dev->last_rx = jiffies;
-			lp->stats.rx_packets++;
-			lp->stats.rx_bytes += pkt_len;
 
 			if( eth16i_debug > 5 ) {
 				int i;
@@ -1208,6 +1204,10 @@
 					printk(KERN_DEBUG " %02x", skb->data[i]);
 				printk(KERN_DEBUG ".\n");
 			}
+			netif_rx(skb);
+			dev->last_rx = jiffies;
+			lp->stats.rx_packets++;
+			lp->stats.rx_bytes += pkt_len;
 
 		} /* else */