mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 07:04:24 +00:00
media: dvbdev: drop refcount on error path in dvb_device_open()
[ Upstream commita2dd235df4
] If call to file->f_op->open() fails, then call dvb_device_put(dvbdev). Fixes:0fc044b2b5
("media: dvbdev: adopts refcnt to avoid UAF") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
4d6e15a5ea
commit
74e3f165d3
1 changed files with 2 additions and 0 deletions
|
@ -104,6 +104,8 @@ static int dvb_device_open(struct inode *inode, struct file *file)
|
|||
err = file->f_op->open(inode, file);
|
||||
up_read(&minor_rwsem);
|
||||
mutex_unlock(&dvbdev_mutex);
|
||||
if (err)
|
||||
dvb_device_put(dvbdev);
|
||||
return err;
|
||||
}
|
||||
fail:
|
||||
|
|
Loading…
Reference in a new issue