summaryrefslogtreecommitdiff
path: root/drivers/media/media-devnode.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-03-21 14:33:12 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-04-06 15:39:56 +0300
commit88336e174645948da269e1812f138f727cd2896b (patch)
tree76f99303d1df74dc3f616e0323b3579cd28d8bb5 /drivers/media/media-devnode.c
parent952f8eef901b170dbe6b48e80f098be5d835a82c (diff)
downloadlinux-88336e174645948da269e1812f138f727cd2896b.tar.xz
[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>
Diffstat (limited to 'drivers/media/media-devnode.c')
-rw-r--r--drivers/media/media-devnode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c
index 29409f440f1c..64a4b1ef3dcd 100644
--- a/drivers/media/media-devnode.c
+++ b/drivers/media/media-devnode.c
@@ -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;
}