diff mbox

media: Fix media_open() to clear filp->private_data in error leg

Message ID 1453938573-13093-1-git-send-email-shuahkh@osg.samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Shuah Khan Jan. 27, 2016, 11:49 p.m. UTC
Fix media_open() to clear filp->private_data when file open
fails.

Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
---
 drivers/media/media-devnode.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Sakari Ailus Jan. 28, 2016, 12:34 a.m. UTC | #1
On Wed, Jan 27, 2016 at 04:49:33PM -0700, Shuah Khan wrote:
> Fix media_open() to clear filp->private_data when file open
> fails.
> 
> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
diff mbox

Patch

diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c
index cea35bf..29409f4 100644
--- a/drivers/media/media-devnode.c
+++ b/drivers/media/media-devnode.c
@@ -181,6 +181,7 @@  static int media_open(struct inode *inode, struct file *filp)
 		ret = mdev->fops->open(filp);
 		if (ret) {
 			put_device(&mdev->dev);
+			filp->private_data = NULL;
 			return ret;
 		}
 	}