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: Shuah Khan <shuah@kernel.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
898bc40bfc
commit
10cb050459
|
@ -291,8 +291,9 @@ void media_devnode_unregister(struct media_devnode *devnode)
|
|||
mutex_lock(&media_devnode_lock);
|
||||
/* Delete the cdev on this minor as well */
|
||||
cdev_device_del(&devnode->cdev, &devnode->dev);
|
||||
mutex_unlock(&media_devnode_lock);
|
||||
devnode->media_dev = NULL;
|
||||
mutex_unlock(&media_devnode_lock);
|
||||
|
||||
put_device(&devnode->dev);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue