mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 22:21:40 +00:00
media: media/pci: Fix memleak in empress_init
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>
This commit is contained in:
parent
cf73a66011
commit
15d0c52241
@ -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