Skip to content

Commit

Permalink
igb: Free any held skb that should have been timestamped on remove
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthew Vick authored and Jeff Kirsher committed Jan 18, 2013
1 parent fc58075 commit badc26d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/net/ethernet/intel/igb/igb_ptp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit badc26d

Please sign in to comment.