summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/intel/igb/igb_ptp.c
diff options
context:
space:
mode:
authorMatthew Vick <matthew.vick@intel.com>2012-12-13 11:20:37 +0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-01-18 16:58:15 +0400
commitbadc26dd648cb3017affb834e9f79995e3911335 (patch)
tree0219e7f9bdf0bc00c740b05571eefbebfd881a70 /drivers/net/ethernet/intel/igb/igb_ptp.c
parentfc5807511699787f69b202d0382eb9f11e1da412 (diff)
downloadlinux-badc26dd648cb3017affb834e9f79995e3911335.tar.xz
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 <richardcochran@gmail.com> Signed-off-by: Matthew Vick <matthew.vick@intel.com> Acked-by: Jacob Keller <Jacob.e.keller@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igb/igb_ptp.c')
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ptp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index 2ec53d7ca1b7..09f61a4a951f 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);