Commit a2dd235d authored by Dan Carpenter's avatar Dan Carpenter Committed by Hans Verkuil

media: dvbdev: drop refcount on error path in dvb_device_open()

If call to file->f_op->open() fails, then call dvb_device_put(dvbdev).

Fixes: 0fc044b2 ("media: dvbdev: adopts refcnt to avoid UAF")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent d8b45ee4
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment