diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 824f12c798d6ed2da217158e5b5b610d92369b8f..4765a50d753778ef60463307e16315669e969b85 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -768,9 +768,10 @@ int i2c_detach_client(struct i2c_client *client) mutex_lock(&adapter->clist_lock); list_del(&client->list); + mutex_unlock(&adapter->clist_lock); + init_completion(&client->released); device_unregister(&client->dev); - mutex_unlock(&adapter->clist_lock); wait_for_completion(&client->released); out: