i40e: Move the mutex lock in i40e_client_unregister
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>
This commit is contained in:
parent
4dec7d045d
commit
cd3be169a5
@ -980,13 +980,13 @@ int i40e_unregister_client(struct i40e_client *client)
|
|||||||
* a close for each of the client instances that were opened.
|
* a close for each of the client instances that were opened.
|
||||||
* client_release function is called to handle this.
|
* client_release function is called to handle this.
|
||||||
*/
|
*/
|
||||||
|
mutex_lock(&i40e_client_mutex);
|
||||||
if (!client || i40e_client_release(client)) {
|
if (!client || i40e_client_release(client)) {
|
||||||
ret = -EIO;
|
ret = -EIO;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: check if device is in reset, or if that matters? */
|
/* TODO: check if device is in reset, or if that matters? */
|
||||||
mutex_lock(&i40e_client_mutex);
|
|
||||||
if (!i40e_client_is_registered(client)) {
|
if (!i40e_client_is_registered(client)) {
|
||||||
pr_info("i40e: Client %s has not been registered\n",
|
pr_info("i40e: Client %s has not been registered\n",
|
||||||
client->name);
|
client->name);
|
||||||
@ -1005,8 +1005,8 @@ int i40e_unregister_client(struct i40e_client *client)
|
|||||||
client->name);
|
client->name);
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_unlock(&i40e_client_mutex);
|
|
||||||
out:
|
out:
|
||||||
|
mutex_unlock(&i40e_client_mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(i40e_unregister_client);
|
EXPORT_SYMBOL(i40e_unregister_client);
|
||||||
|
Loading…
Reference in New Issue
Block a user