]> git.karo-electronics.de Git - linux-beck.git/commitdiff
gianfar: Fix missing sock reference when processing TX time stamps
authorManfred Rudigier <Manfred.Rudigier@omicron.at>
Mon, 9 Jan 2012 23:26:50 +0000 (23:26 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Jan 2012 23:26:01 +0000 (15:26 -0800)
When there is not enough headroom in the skb a private copy will be made.
However, the private copy had no reference to the socket and consequently
no time stamp could be queued on the socket error queue during the
skb_tstamp_tx function. This patch fixes this issue by also stealing the
sock reference from the original skb after making the private copy.

Signed-off-by: Manfred Rudigier <manfred.rudigier@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/gianfar.c

index e01cdaa722a977eac9b6c66513dfe13a44b97a44..2b3c12992127b548635147aa6029541d6fce9954 100644 (file)
@@ -2086,6 +2086,10 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        kfree_skb(skb);
                        return NETDEV_TX_OK;
                }
+
+               /* Steal sock reference for processing TX time stamps */
+               swap(skb_new->sk, skb->sk);
+               swap(skb_new->destructor, skb->destructor);
                kfree_skb(skb);
                skb = skb_new;
        }