From: Max Kellermann Date: Mon, 21 Mar 2016 11:33:12 +0000 (-0700) Subject: [media] media-devnode: add missing mutex lock in error handler X-Git-Tag: v4.14-rc1~2906^2~175 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88336e174645948da269e1812f138f727cd2896b;p=platform%2Fkernel%2Flinux-rpi.git [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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c index 29409f4..64a4b1e 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; }