From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Jacob Keller <jacob.e.keller@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 1/9] i40e: free skb after clearing lock in ptp_stop
Date: Tue, 22 May 2018 10:45:19 -0700 [thread overview]
Message-ID: <20180522174527.19680-2-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <20180522174527.19680-1-jeffrey.t.kirsher@intel.com>
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>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@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 d50d84927e6b..35f2866b38c6 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.17.0
next prev parent reply other threads:[~2018-05-22 17:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-22 17:45 [net-next 0/9][pull request] 40GbE Intel Wired LAN Driver Updates 2018-05-22 Jeff Kirsher
2018-05-22 17:45 ` Jeff Kirsher [this message]
2018-05-22 17:45 ` [net-next 2/9] i40e: always return VEB stat strings Jeff Kirsher
2018-05-22 17:45 ` [net-next 3/9] i40e: always return all queue " Jeff Kirsher
2018-05-22 17:45 ` [net-next 4/9] i40e: split i40e_get_strings() into smaller functions Jeff Kirsher
2018-05-22 17:45 ` [net-next 5/9] i40e: use WARN_ONCE to replace the commented BUG_ON size check Jeff Kirsher
2018-05-22 17:45 ` [net-next 6/9] i40e: fold prefix strings directly into stat names Jeff Kirsher
2018-05-22 17:45 ` [net-next 7/9] i40e: update data pointer directly when copying to the buffer Jeff Kirsher
2018-05-22 17:45 ` [net-next 8/9] i40e: add function doc headers for ethtool stats functions Jeff Kirsher
2018-05-22 17:45 ` [net-next 9/9] i40e: use the more traditional 'i' loop variable Jeff Kirsher
2018-05-22 19:46 ` [net-next 0/9][pull request] 40GbE Intel Wired LAN Driver Updates 2018-05-22 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180522174527.19680-2-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=jacob.e.keller@intel.com \
--cc=jogreene@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@redhat.com \
--cc=sassmann@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).