Commit 10cb0504 authored by Shuah Khan's avatar Shuah Khan Committed by Mauro Carvalho Chehab

media: Clear devnode->media_dev holding media_devnode_lock

Fix media_devnode_unregister() to clear devnode->media_dev while holding
media_devnode_lock. media_devnode_register()'s cdev_add_error handling
does this correctly.
Signed-off-by: default avatarShuah Khan <shuah@kernel.org>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 898bc40b
...@@ -291,8 +291,9 @@ void media_devnode_unregister(struct media_devnode *devnode) ...@@ -291,8 +291,9 @@ void media_devnode_unregister(struct media_devnode *devnode)
mutex_lock(&media_devnode_lock); mutex_lock(&media_devnode_lock);
/* Delete the cdev on this minor as well */ /* Delete the cdev on this minor as well */
cdev_device_del(&devnode->cdev, &devnode->dev); cdev_device_del(&devnode->cdev, &devnode->dev);
mutex_unlock(&media_devnode_lock);
devnode->media_dev = NULL; devnode->media_dev = NULL;
mutex_unlock(&media_devnode_lock);
put_device(&devnode->dev); put_device(&devnode->dev);
} }
......
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