Unverified Commit 7fd59ddb authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12542 media: pci: cx23885: check cx23885_vdev_init() return

parents 74ea6865 c8c929b9
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -1353,6 +1353,10 @@ int cx23885_video_register(struct cx23885_dev *dev)
	/* register Video device */
	dev->video_dev = cx23885_vdev_init(dev, dev->pci,
		&cx23885_video_template, "video");
	if (!dev->video_dev) {
		err = -ENOMEM;
		goto fail_unreg;
	}
	dev->video_dev->queue = &dev->vb2_vidq;
	dev->video_dev->device_caps = V4L2_CAP_READWRITE | V4L2_CAP_STREAMING |
				      V4L2_CAP_AUDIO | V4L2_CAP_VIDEO_CAPTURE;
@@ -1381,6 +1385,10 @@ int cx23885_video_register(struct cx23885_dev *dev)
	/* register VBI device */
	dev->vbi_dev = cx23885_vdev_init(dev, dev->pci,
		&cx23885_vbi_template, "vbi");
	if (!dev->vbi_dev) {
		err = -ENOMEM;
		goto fail_unreg;
	}
	dev->vbi_dev->queue = &dev->vb2_vbiq;
	dev->vbi_dev->device_caps = V4L2_CAP_READWRITE | V4L2_CAP_STREAMING |
				    V4L2_CAP_AUDIO | V4L2_CAP_VBI_CAPTURE;