Skip to content

Commit

Permalink
V4L/DVB (8695): usbvideo: add proper error check and add release func…
Browse files Browse the repository at this point in the history
…tion

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Oct 12, 2008
1 parent 66c6bda commit e758c6f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/media/video/usbvideo/usbvideo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,10 @@ struct uvd *usbvideo_AllocateDevice(struct usbvideo *cams)

EXPORT_SYMBOL(usbvideo_AllocateDevice);

static void usbvideo_dummy_release(struct video_device *vfd)
{
}

int usbvideo_RegisterVideoDevice(struct uvd *uvd)
{
char tmp1[20], tmp2[20]; /* Buffers for printing */
Expand Down Expand Up @@ -1039,7 +1043,8 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd)
return -EINVAL;
}
uvd->vdev.parent = &uvd->dev->dev;
if (video_register_device(&uvd->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
uvd->vdev.release = usbvideo_dummy_release;
if (video_register_device(&uvd->vdev, VFL_TYPE_GRABBER, video_nr) < 0) {
err("%s: video_register_device failed", __func__);
return -EPIPE;
}
Expand Down

0 comments on commit e758c6f

Please sign in to comment.