mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 14:42:37 +02:00
media: media/pci: Fix memleak in empress_init
[ Upstream commit15d0c52241] When vb2_queue_init() fails, dev->empress_dev should be released just like other error handling paths. Fixes:2ada815fc4("[media] saa7134: convert to vb2") Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
451c7cb236
commit
172e30ea38
|
|
@ -282,8 +282,11 @@ static int empress_init(struct saa7134_dev *dev)
|
|||
q->lock = &dev->lock;
|
||||
q->dev = &dev->pci->dev;
|
||||
err = vb2_queue_init(q);
|
||||
if (err)
|
||||
if (err) {
|
||||
video_device_release(dev->empress_dev);
|
||||
dev->empress_dev = NULL;
|
||||
return err;
|
||||
}
|
||||
dev->empress_dev->queue = q;
|
||||
dev->empress_dev->device_caps = V4L2_CAP_READWRITE | V4L2_CAP_STREAMING |
|
||||
V4L2_CAP_VIDEO_CAPTURE;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user