mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 04:01:48 -04:00
[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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
parent
c56d34a73e
commit
bf244f665d
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue