From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Catherine Sullivan <catherine.sullivan@intel.com>,
netdev@vger.kernel.org, nhorman@redhat.com, sassmann@redhat.com,
jogreene@redhat.com, guru.anbalagane@oracle.com,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 09/11] i40e: Move the mutex lock in i40e_client_unregister
Date: Fri, 22 Jul 2016 00:36:37 -0700 [thread overview]
Message-ID: <1469172999-8969-10-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1469172999-8969-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Catherine Sullivan <catherine.sullivan@intel.com>
We need to lock the client list around the i40e_client_release call to
prevent the release from interrupting the client instances while they are
being added.
Change-Id: I99993f20179aaf8730207833e7d0869d2ccffa1d
Signed-off-by: Catherine Sullivan <catherine.sullivan@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_client.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c
index 0e6ac84..e1370c5 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_client.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
@@ -980,13 +980,13 @@ int i40e_unregister_client(struct i40e_client *client)
* a close for each of the client instances that were opened.
* client_release function is called to handle this.
*/
+ mutex_lock(&i40e_client_mutex);
if (!client || i40e_client_release(client)) {
ret = -EIO;
goto out;
}
/* TODO: check if device is in reset, or if that matters? */
- mutex_lock(&i40e_client_mutex);
if (!i40e_client_is_registered(client)) {
pr_info("i40e: Client %s has not been registered\n",
client->name);
@@ -1005,8 +1005,8 @@ int i40e_unregister_client(struct i40e_client *client)
client->name);
}
- mutex_unlock(&i40e_client_mutex);
out:
+ mutex_unlock(&i40e_client_mutex);
return ret;
}
EXPORT_SYMBOL(i40e_unregister_client);
--
2.5.5
next prev parent reply other threads:[~2016-07-22 7:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-22 7:36 [net-next 00/11][pull request] 40GbE Intel Wired LAN Driver Updates 2016-07-22 Jeff Kirsher
2016-07-22 7:36 ` [net-next 01/11] i40e: avoid null pointer dereference Jeff Kirsher
2016-07-22 7:36 ` [net-next 02/11] i40e: Fix to show correct Advertised Link Modes when link is down Jeff Kirsher
2016-07-22 7:36 ` [net-next 03/11] i40e/i40evf: remove useless initializer Jeff Kirsher
2016-07-22 7:36 ` [net-next 04/11] i40e: Remove device ID 0x37D4 Jeff Kirsher
2016-07-22 7:36 ` [net-next 05/11] i40evf: add hyperv dev ids Jeff Kirsher
2016-07-22 7:36 ` [net-next 06/11] i40e: refactor Rx filter handling Jeff Kirsher
2016-07-22 7:36 ` [net-next 07/11] i40e/i40evf-bump version to 1.6.11 Jeff Kirsher
2016-07-22 7:36 ` [net-next 08/11] i40e: Remove redundant memset Jeff Kirsher
2016-07-22 7:36 ` Jeff Kirsher [this message]
2016-07-22 7:36 ` [net-next 10/11] i40e: add missing link advertise setting Jeff Kirsher
2016-07-22 7:36 ` [net-next 11/11] i40e: Explicitly write platform-specific mac address after PF reset Jeff Kirsher
2016-07-25 17:46 ` [net-next 00/11][pull request] 40GbE Intel Wired LAN Driver Updates 2016-07-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=1469172999-8969-10-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=catherine.sullivan@intel.com \
--cc=davem@davemloft.net \
--cc=guru.anbalagane@oracle.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).