aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2016-03-21 09:30:28 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-05-07 10:43:53 -0400
commitbf244f665d76d20312c80524689b32a752888838 (patch)
tree592a03ddfb450ffa7e0da8741a8bcfd373b80755
parentc56d34a73ea3622fbc3f5a85140f2353f14b591c (diff)
[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>
-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)
197 if (mdev->fops->release) 197 if (mdev->fops->release)
198 mdev->fops->release(filp); 198 mdev->fops->release(filp);
199 199
200 filp->private_data = NULL;
201
200 /* decrease the refcount unconditionally since the release() 202 /* decrease the refcount unconditionally since the release()
201 return value is ignored. */ 203 return value is ignored. */
202 put_device(&mdev->dev); 204 put_device(&mdev->dev);
203 filp->private_data = NULL;
204 return 0; 205 return 0;
205} 206}
206 207