forked from luck/tmp_suning_uos_patched
V4L/DVB (8779): v4l: fix more incorrect video_register_device result checks
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
cba99ae819
commit
dc60de338f
|
@ -946,8 +946,7 @@ static int init_bwqcam(struct parport *port)
|
||||||
|
|
||||||
printk(KERN_INFO "Connectix Quickcam on %s\n", qcam->pport->name);
|
printk(KERN_INFO "Connectix Quickcam on %s\n", qcam->pport->name);
|
||||||
|
|
||||||
if(video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr)==-1)
|
if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
|
||||||
{
|
|
||||||
parport_unregister_device(qcam->pdev);
|
parport_unregister_device(qcam->pdev);
|
||||||
kfree(qcam);
|
kfree(qcam);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
|
@ -787,8 +787,7 @@ static int init_cqcam(struct parport *port)
|
||||||
|
|
||||||
parport_release(qcam->pdev);
|
parport_release(qcam->pdev);
|
||||||
|
|
||||||
if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr)==-1)
|
if (video_register_device(&qcam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
|
||||||
{
|
|
||||||
printk(KERN_ERR "Unable to register Colour QuickCam on %s\n",
|
printk(KERN_ERR "Unable to register Colour QuickCam on %s\n",
|
||||||
qcam->pport->name);
|
qcam->pport->name);
|
||||||
parport_unregister_device(qcam->pdev);
|
parport_unregister_device(qcam->pdev);
|
||||||
|
|
|
@ -3955,7 +3955,7 @@ struct cam_data *cpia_register_camera(struct cpia_camera_ops *ops, void *lowleve
|
||||||
camera->lowlevel_data = lowlevel;
|
camera->lowlevel_data = lowlevel;
|
||||||
|
|
||||||
/* register v4l device */
|
/* register v4l device */
|
||||||
if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
|
if (video_register_device(&camera->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
|
||||||
kfree(camera);
|
kfree(camera);
|
||||||
printk(KERN_DEBUG "video_register_device failed\n");
|
printk(KERN_DEBUG "video_register_device failed\n");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -1958,8 +1958,7 @@ int cpia2_register_camera(struct camera_data *cam)
|
||||||
reset_camera_struct_v4l(cam);
|
reset_camera_struct_v4l(cam);
|
||||||
|
|
||||||
/* register v4l device */
|
/* register v4l device */
|
||||||
if (video_register_device
|
if (video_register_device(cam->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
|
||||||
(cam->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
|
|
||||||
ERR("video_register_device failed\n");
|
ERR("video_register_device failed\n");
|
||||||
video_device_release(cam->vdev);
|
video_device_release(cam->vdev);
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
|
@ -1397,7 +1397,7 @@ static int se401_probe(struct usb_interface *intf,
|
||||||
mutex_init(&se401->lock);
|
mutex_init(&se401->lock);
|
||||||
wmb();
|
wmb();
|
||||||
|
|
||||||
if (video_register_device(&se401->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
|
if (video_register_device(&se401->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
|
||||||
kfree(se401);
|
kfree(se401);
|
||||||
err("video_register_device failed");
|
err("video_register_device failed");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
|
@ -1462,7 +1462,7 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id
|
||||||
mutex_init (&stv680->lock);
|
mutex_init (&stv680->lock);
|
||||||
wmb ();
|
wmb ();
|
||||||
|
|
||||||
if (video_register_device (stv680->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
|
if (video_register_device(stv680->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
|
||||||
PDEBUG (0, "STV(e): video_register_device failed");
|
PDEBUG (0, "STV(e): video_register_device failed");
|
||||||
retval = -EIO;
|
retval = -EIO;
|
||||||
goto error_vdev;
|
goto error_vdev;
|
||||||
|
|
|
@ -866,7 +866,7 @@ vicam_probe( struct usb_interface *intf, const struct usb_device_id *id)
|
||||||
cam->udev = dev;
|
cam->udev = dev;
|
||||||
cam->bulkEndpoint = bulkEndpoint;
|
cam->bulkEndpoint = bulkEndpoint;
|
||||||
|
|
||||||
if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1) == -1) {
|
if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, -1) < 0) {
|
||||||
kfree(cam);
|
kfree(cam);
|
||||||
printk(KERN_WARNING "video_register_device failed\n");
|
printk(KERN_WARNING "video_register_device failed\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
|
@ -334,7 +334,7 @@ static int w9966_init(struct w9966_dev* cam, struct parport* port)
|
||||||
memcpy(&cam->vdev, &w9966_template, sizeof(struct video_device));
|
memcpy(&cam->vdev, &w9966_template, sizeof(struct video_device));
|
||||||
cam->vdev.priv = cam;
|
cam->vdev.priv = cam;
|
||||||
|
|
||||||
if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) == -1)
|
if (video_register_device(&cam->vdev, VFL_TYPE_GRABBER, video_nr) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
w9966_setState(cam, W9966_STATE_VDEV, W9966_STATE_VDEV);
|
w9966_setState(cam, W9966_STATE_VDEV, W9966_STATE_VDEV);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user