From: Avinash Dayanand Date: Wed, 17 Aug 2016 23:04:06 +0000 (-0700) Subject: i40e: Correcting mutex usage in client code X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0d8ab54a4119880bb9cb4680da1f5e9068d0d333;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git i40e: Correcting mutex usage in client code Correcting the mutex usage, in client_subtask(), mutex_unlock has to be called just before client_del_instance() since this function opens and later closes the same mutex again. Similarly in client_is_registered removing the mutex since it closes the mutex twice. This is a patch suggested by RDMA team. Change-ID: Icce519c266e4221b8a2a72a15ba5bf01750e5852 Signed-off-by: Avinash Dayanand Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher --- diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c index 09a37cfcffd6..5404b32c9adf 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_client.c +++ b/drivers/net/ethernet/intel/i40e/i40e_client.c @@ -576,6 +576,7 @@ void i40e_client_subtask(struct i40e_pf *pf) set_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state); } else { /* remove client instance */ + mutex_unlock(&i40e_client_instance_mutex); i40e_client_del_instance(pf, client); atomic_dec(&client->ref_cnt); continue;