From: Matthew Vick Date: Thu, 13 Dec 2012 07:20:37 +0000 (+0000) Subject: igb: Free any held skb that should have been timestamped on remove X-Git-Tag: upstream/snapshot3+hdmi~5708^2~334^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=badc26dd648cb3017affb834e9f79995e3911335;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git igb: Free any held skb that should have been timestamped on remove To prevent a race condition where an skb has been saved to return the Tx timestamp later and the driver is removed, add a check to determine if we have an skb stored and, if so, free it. Cc: Richard Cochran Signed-off-by: Matthew Vick Acked-by: Jacob Keller Tested-by: Aaron Brown Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c index 2ec53d7..09f61a4 100644 --- a/drivers/net/ethernet/intel/igb/igb_ptp.c +++ b/drivers/net/ethernet/intel/igb/igb_ptp.c @@ -856,6 +856,10 @@ void igb_ptp_stop(struct igb_adapter *adapter) } cancel_work_sync(&adapter->ptp_tx_work); + if (adapter->ptp_tx_skb) { + dev_kfree_skb_any(adapter->ptp_tx_skb); + adapter->ptp_tx_skb = NULL; + } if (adapter->ptp_clock) { ptp_clock_unregister(adapter->ptp_clock);