Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bf244f66 authored by Max Kellermann's avatar Max Kellermann Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarMax Kellermann <max@duempel.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent c56d34a7
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;
}