[media] media-devnode: add missing mutex lock in error handler

We should protect the device unregister patch too, at the error
condition.

Signed-off-by: Max Kellermann <max@duempel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Max Kellermann 2016-03-21 04:33:12 -07:00 committed by Mauro Carvalho Chehab
parent 952f8eef90
commit 88336e1746

View file

@ -267,8 +267,11 @@ int __must_check media_devnode_register(struct media_devnode *mdev,
return 0;
error:
mutex_lock(&media_devnode_lock);
cdev_del(&mdev->cdev);
clear_bit(mdev->minor, media_devnode_nums);
mutex_unlock(&media_devnode_lock);
return ret;
}