diff options
author | Anjali Singhai Jain <anjali.singhai@intel.com> | 2016-07-27 12:02:30 -0700 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2016-08-18 11:43:10 -0700 |
commit | 3a0f52928a0a06a7c4c735cd325ca646a1e40fae (patch) | |
tree | 1205bad53950779dc5c3140dfd26cf1a1859df4e /drivers/net/ethernet/intel/i40e/i40e_client.c | |
parent | eb27163b2e0a2606a044dfdf662ff1c26a63515c (diff) | |
download | linux-stable-3a0f52928a0a06a7c4c735cd325ca646a1e40fae.tar.gz linux-stable-3a0f52928a0a06a7c4c735cd325ca646a1e40fae.tar.bz2 linux-stable-3a0f52928a0a06a7c4c735cd325ca646a1e40fae.zip |
i40e: Fix a bug where a client close can be called before an open is complete
The client->open call in this path was not protected with the
client instance mutex, and hence the client->close can get initiated
before the open completes.
Change-Id: I0ed60c38868dd3f44966b6ed49a063d0e5b7edf5
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/i40e/i40e_client.c')
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_client.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c index e6b9263f5c0d..8726269188f3 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_client.c +++ b/drivers/net/ethernet/intel/i40e/i40e_client.c @@ -541,6 +541,7 @@ void i40e_client_subtask(struct i40e_pf *pf) client->name, pf->hw.pf_id, pf->hw.bus.device, pf->hw.bus.func); + mutex_lock(&i40e_client_instance_mutex); /* Send an Open request to the client */ atomic_inc(&cdev->ref_cnt); if (client->ops && client->ops->open) @@ -554,6 +555,7 @@ void i40e_client_subtask(struct i40e_pf *pf) atomic_dec(&client->ref_cnt); continue; } + mutex_unlock(&i40e_client_instance_mutex); } mutex_unlock(&i40e_client_mutex); } |