summaryrefslogtreecommitdiff
path: root/drivers/media/usb/s2255
diff options
context:
space:
mode:
authorDean Anderson <linux-dev@sensoray.com>2014-02-05 15:58:20 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-02-28 14:25:34 -0300
commit6a5b63b3cbf774f6a576133fccb92f54cc8a23e1 (patch)
tree56264f397deb093727406fc174c5632628b0b42a /drivers/media/usb/s2255
parent47d8c881c304642a68d398b87d9e8846e643c81a (diff)
[media] s2255drv: fix for return code not checked
Start acquisition return code was not being checked. Return error if start acquisition fails. Signed-off-by: Dean Anderson <linux-dev@sensoray.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/usb/s2255')
-rw-r--r--drivers/media/usb/s2255/s2255drv.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c
index 4c483adafbe9..787b591be3cf 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -1230,12 +1230,16 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
vc->buffer.frame[j].cur_size = 0;
}
res = videobuf_streamon(&fh->vb_vidq);
- if (res == 0) {
- s2255_start_acquire(vc);
- vc->b_acquire = 1;
- } else
+ if (res != 0) {
res_free(fh);
-
+ return res;
+ }
+ res = s2255_start_acquire(vc);
+ if (res != 0) {
+ res_free(fh);
+ return res;
+ }
+ vc->b_acquire = 1;
return res;
}
@@ -2373,7 +2377,7 @@ static int s2255_start_acquire(struct s2255_vc *vc)
dprintk(dev, 2, "start acquire exit[%d] %d\n", vc->idx, res);
mutex_unlock(&dev->cmdlock);
- return 0;
+ return res;
}
static int s2255_stop_acquire(struct s2255_vc *vc)