diff --git a/drivers/android/binderfs.c b/drivers/android/binderfs.c index 94c6446604fc..21fd218796d6 100644 --- a/drivers/android/binderfs.c +++ b/drivers/android/binderfs.c @@ -271,13 +271,13 @@ static void binderfs_evict_inode(struct inode *inode) mutex_lock(&binderfs_minors_mutex); --info->device_count; ida_free(&binderfs_minors, device->miscdev.minor); - mutex_unlock(&binderfs_minors_mutex); if (refcount_dec_and_test(&device->ref)) { hlist_del_init(&device->hlist); kfree(device->context.name); kfree(device); } + mutex_unlock(&binderfs_minors_mutex); } static int binderfs_fs_context_parse_param(struct fs_context *fc,