mirror of
https://github.com/torvalds/linux.git
synced 2026-11-10 17:11:02 +01:00
media: em28xx: setup queues before registering V4L2 device
Adjust em28xx_v4l2_init() to setup video and VBI capture queues before calling video_register_device(), thus making error cleanup work as expected. Reported-by: syzbot+dd0f06181ab66b93dc00@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=dd0f06181ab66b93dc00 Suggested-by: Hans Verkuil <hverkuil+cisco@kernel.org> Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
parent
8a3e233a83
commit
487344a63f
|
|
@ -2987,6 +2987,14 @@ static int em28xx_v4l2_init(struct em28xx *dev)
|
|||
if (dev->chip_id == CHIP_ID_EM2828X || dev->board.decoder == EM28XX_BUILTIN)
|
||||
v4l2_disable_ioctl(&v4l2->vdev, VIDIOC_ENUM_FRAMESIZES);
|
||||
|
||||
/* initialize videobuf2 stuff */
|
||||
ret = em28xx_vb2_setup(dev);
|
||||
if (ret) {
|
||||
dev_err(&dev->intf->dev,
|
||||
"unable to setup videobuf queues (error=%i).\n", ret);
|
||||
goto unregister_dev;
|
||||
}
|
||||
|
||||
/* register v4l2 video video_device */
|
||||
ret = video_register_device(&v4l2->vdev, VFL_TYPE_VIDEO,
|
||||
video_nr[dev->devno]);
|
||||
|
|
@ -3072,9 +3080,6 @@ static int em28xx_v4l2_init(struct em28xx *dev)
|
|||
/* Save some power by putting tuner to sleep */
|
||||
v4l2_device_call_all(&v4l2->v4l2_dev, 0, tuner, standby);
|
||||
|
||||
/* initialize videobuf2 stuff */
|
||||
em28xx_vb2_setup(dev);
|
||||
|
||||
dev_info(&dev->intf->dev,
|
||||
"V4L2 extension successfully initialized\n");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user