Skip to content

Commit 3a0f529

Browse files
anjalisinghai1Jeff Kirsher
authored andcommitted
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 <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent eb27163 commit 3a0f529

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/ethernet/intel/i40e/i40e_client.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ void i40e_client_subtask(struct i40e_pf *pf)
541541
client->name, pf->hw.pf_id,
542542
pf->hw.bus.device, pf->hw.bus.func);
543543

544+
mutex_lock(&i40e_client_instance_mutex);
544545
/* Send an Open request to the client */
545546
atomic_inc(&cdev->ref_cnt);
546547
if (client->ops && client->ops->open)
@@ -554,6 +555,7 @@ void i40e_client_subtask(struct i40e_pf *pf)
554555
atomic_dec(&client->ref_cnt);
555556
continue;
556557
}
558+
mutex_unlock(&i40e_client_instance_mutex);
557559
}
558560
mutex_unlock(&i40e_client_mutex);
559561
}

0 commit comments

Comments
 (0)