diff options
Diffstat (limited to 'drivers/media/usb/cpia2')
-rw-r--r-- | drivers/media/usb/cpia2/cpia2_usb.c | 4 | ||||
-rw-r--r-- | drivers/media/usb/cpia2/cpia2_v4l.c | 25 |
2 files changed, 8 insertions, 21 deletions
diff --git a/drivers/media/usb/cpia2/cpia2_usb.c b/drivers/media/usb/cpia2/cpia2_usb.c index 17468f7d78ed..3ab80a7b4498 100644 --- a/drivers/media/usb/cpia2/cpia2_usb.c +++ b/drivers/media/usb/cpia2/cpia2_usb.c @@ -676,6 +676,10 @@ static int submit_urbs(struct camera_data *cam) if (!urb) { for (j = 0; j < i; j++) usb_free_urb(cam->sbuf[j].urb); + for (j = 0; j < NUM_SBUF; j++) { + kfree(cam->sbuf[j].data); + cam->sbuf[j].data = NULL; + } return -ENOMEM; } diff --git a/drivers/media/usb/cpia2/cpia2_v4l.c b/drivers/media/usb/cpia2/cpia2_v4l.c index 0feae825cebb..626264a56517 100644 --- a/drivers/media/usb/cpia2/cpia2_v4l.c +++ b/drivers/media/usb/cpia2/cpia2_v4l.c @@ -292,28 +292,13 @@ static int cpia2_s_input(struct file *file, void *fh, unsigned int i) static int cpia2_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdesc *f) { - int index = f->index; - - if (index < 0 || index > 1) - return -EINVAL; + if (f->index > 1) + return -EINVAL; - memset(f, 0, sizeof(*f)); - f->index = index; - f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - f->flags = V4L2_FMT_FLAG_COMPRESSED; - switch(index) { - case 0: - strscpy(f->description, "MJPEG", sizeof(f->description)); + if (f->index == 0) f->pixelformat = V4L2_PIX_FMT_MJPEG; - break; - case 1: - strscpy(f->description, "JPEG", sizeof(f->description)); + else f->pixelformat = V4L2_PIX_FMT_JPEG; - break; - default: - return -EINVAL; - } - return 0; } @@ -338,7 +323,6 @@ static int cpia2_try_fmt_vid_cap(struct file *file, void *fh, f->fmt.pix.bytesperline = 0; f->fmt.pix.sizeimage = cam->frame_size; f->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG; - f->fmt.pix.priv = 0; switch (cpia2_match_video_size(f->fmt.pix.width, f->fmt.pix.height)) { case VIDEOSIZE_VGA: @@ -449,7 +433,6 @@ static int cpia2_g_fmt_vid_cap(struct file *file, void *fh, f->fmt.pix.bytesperline = 0; f->fmt.pix.sizeimage = cam->frame_size; f->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG; - f->fmt.pix.priv = 0; return 0; } |