Commit 0696384a authored by Max Kellermann's avatar Max Kellermann Committed by Khalid Elmously

media-devnode: add missing mutex lock in error handler

BugLink: https://bugs.launchpad.net/bugs/1883916

commit 88336e17 upstream.

We should protect the device unregister patch too, at the error
condition.
Signed-off-by: default avatarMax Kellermann <max@duempel.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: default avatarBen Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent 83b08905
......@@ -282,8 +282,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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment