From: Manfred Rudigier Date: Mon, 9 Jan 2012 23:26:50 +0000 (+0000) Subject: gianfar: Fix missing sock reference when processing TX time stamps X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=db83d136d7f7534857cd9c6e588adc08a428b190;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git gianfar: Fix missing sock reference when processing TX time stamps 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index e01cdaa722a9..2b3c12992127 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c @@ -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; }