Intel-Wired-Lan Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [next PATCH S92 1/9] i40e: free skb after clearing lock in ptp_stop
@ 2018-05-17  8:08 Alice Michael
  2018-05-17  8:08 ` [Intel-wired-lan] [next PATCH S92 2/9] i40e: always return VEB stat strings Alice Michael
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Alice Michael @ 2018-05-17  8:08 UTC (permalink / raw)
  To: intel-wired-lan

From: Jacob Keller <jacob.e.keller@intel.com>

Use the same logic to free the skb after clearing the Tx timestamp bit
lock in i40e_ptp_stop as we use in the other locations. It is not as
important here since we are not racing against a future Tx timestamp
request (as we are disabling PTP at this point). However it is good to
be consistent in how we approach the bit lock so that future callers
don't copy the old anti-pattern.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_ptp.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
index d50d849..35f2866 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -799,9 +799,11 @@ void i40e_ptp_stop(struct i40e_pf *pf)
 	pf->ptp_rx = false;
 
 	if (pf->ptp_tx_skb) {
-		dev_kfree_skb_any(pf->ptp_tx_skb);
+		struct sk_buff *skb = pf->ptp_tx_skb;
+
 		pf->ptp_tx_skb = NULL;
 		clear_bit_unlock(__I40E_PTP_TX_IN_PROGRESS, pf->state);
+		dev_kfree_skb_any(skb);
 	}
 
 	if (pf->ptp_clock) {
-- 
2.9.5


^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2018-05-17 22:15 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-17  8:08 [Intel-wired-lan] [next PATCH S92 1/9] i40e: free skb after clearing lock in ptp_stop Alice Michael
2018-05-17  8:08 ` [Intel-wired-lan] [next PATCH S92 2/9] i40e: always return VEB stat strings Alice Michael
2018-05-17 22:10   ` Bowers, AndrewX
2018-05-17  8:08 ` [Intel-wired-lan] [next PATCH S92 3/9] i40e: always return all queue " Alice Michael
2018-05-17 22:12   ` Bowers, AndrewX
2018-05-17  8:08 ` [Intel-wired-lan] [next PATCH S92 4/9] i40e: split i40e_get_strings() into smaller functions Alice Michael
2018-05-17 22:12   ` Bowers, AndrewX
2018-05-17  8:08 ` [Intel-wired-lan] [next PATCH S92 5/9] i40e: use WARN_ONCE to replace the commented BUG_ON size check Alice Michael
2018-05-17 22:13   ` Bowers, AndrewX
2018-05-17  8:08 ` [Intel-wired-lan] [next PATCH S92 6/9] i40e: fold prefix strings directly into stat names Alice Michael
2018-05-17 22:13   ` Bowers, AndrewX
2018-05-17  8:08 ` [Intel-wired-lan] [next PATCH S92 7/9] i40e: update data pointer directly when copying to the buffer Alice Michael
2018-05-17 19:13   ` Shannon Nelson
2018-05-17 22:14   ` Bowers, AndrewX
2018-05-17  8:08 ` [Intel-wired-lan] [next PATCH S92 8/9] i40e: add function doc headers for ethtool stats functions Alice Michael
2018-05-17 22:15   ` Bowers, AndrewX
2018-05-17  8:08 ` [Intel-wired-lan] [next PATCH S92 9/9] i40e: use the more traditional 'i' loop variable Alice Michael
2018-05-17 22:15   ` Bowers, AndrewX
2018-05-17 22:10 ` [Intel-wired-lan] [next PATCH S92 1/9] i40e: free skb after clearing lock in ptp_stop Bowers, AndrewX

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox