summaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-03-21 10:30:28 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-05-07 11:43:53 -0300
commitbf244f665d76d20312c80524689b32a752888838 (patch)
tree592a03ddfb450ffa7e0da8741a8bcfd373b80755 /drivers/media
parentc56d34a73ea3622fbc3f5a85140f2353f14b591c (diff)
downloadlinux-bf244f665d76d20312c80524689b32a752888838.tar.bz2
[media] drivers/media/media-devnode: clear private_data before put_device()
Callbacks invoked from put_device() may free the struct media_devnode pointer, so any cleanup needs to be done before put_device(). Signed-off-by: Max Kellermann <max@duempel.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/media-devnode.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c
index 64a4b1ef3dcd..b66dc9d0766b 100644
--- a/drivers/media/media-devnode.c
+++ b/drivers/media/media-devnode.c
@@ -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;
}