Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[deliverable/linux.git] / drivers / media / media-devnode.c
index 29409f440f1caef38f82694b382d3b66a3895ffb..b66dc9d0766bd87afaeb584f495937305f591637 100644 (file)
@@ -197,10 +197,11 @@ static int media_release(struct inode *inode, struct file *filp)
        if (mdev->fops->release)
                mdev->fops->release(filp);
 
+       filp->private_data = NULL;
+
        /* decrease the refcount unconditionally since the release()
           return value is ignored. */
        put_device(&mdev->dev);
-       filp->private_data = NULL;
        return 0;
 }
 
@@ -267,8 +268,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;
 }
 
This page took 0.025628 seconds and 5 git commands to generate.