Skip to content

Commit

Permalink
i40e: Fix a bug where a client close can be called before an open is …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Anjali Singhai Jain authored and Jeff Kirsher committed Aug 18, 2016
1 parent eb27163 commit 3a0f529
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/net/ethernet/intel/i40e/i40e_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}
Expand Down

0 comments on commit 3a0f529

Please sign in to comment.