diff mbox

ax25: Use skb_orphan before touching skb destructor

Message ID 20090622085204.GA22333@gondor.apana.org.au
State Superseded, archived
Delegated to: David Miller
Headers show

Commit Message

Herbert Xu June 22, 2009, 8:52 a.m. UTC
Hi Dave:

This is the first in a series of patches (yet to be written :)
to allow the removal of the skb_orphan call that I recently
added to netif_receive_skb.

ax25: Use skb_orphan before touching skb destructor

Before taking ownership of skb->destructor, we should ensure
that the existing destructor is called through skb_orphan.

In future this should be moved further down to where we actually
call skb_set_owner_*.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>


Cheers,
diff mbox

Patch

diff --git a/net/ax25/ax25_in.c b/net/ax25/ax25_in.c
index 5f1d210..de56d39 100644
--- a/net/ax25/ax25_in.c
+++ b/net/ax25/ax25_in.c
@@ -437,8 +437,7 @@  free:
 int ax25_kiss_rcv(struct sk_buff *skb, struct net_device *dev,
 		  struct packet_type *ptype, struct net_device *orig_dev)
 {
-	skb->sk = NULL;		/* Initially we don't know who it's for */
-	skb->destructor = NULL;	/* Who initializes this, dammit?! */
+	skb_orphan(skb);
 
 	if (!net_eq(dev_net(dev), &init_net)) {
 		kfree_skb(skb);