Commit 6a5b63b3 authored by Dean Anderson's avatar Dean Anderson Committed by Mauro Carvalho Chehab

[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: default avatarDean Anderson <linux-dev@sensoray.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 47d8c881
...@@ -1230,12 +1230,16 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i) ...@@ -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; vc->buffer.frame[j].cur_size = 0;
} }
res = videobuf_streamon(&fh->vb_vidq); res = videobuf_streamon(&fh->vb_vidq);
if (res == 0) { if (res != 0) {
s2255_start_acquire(vc); res_free(fh);
vc->b_acquire = 1; return res;
} else }
res = s2255_start_acquire(vc);
if (res != 0) {
res_free(fh); res_free(fh);
return res;
}
vc->b_acquire = 1;
return res; return res;
} }
...@@ -2373,7 +2377,7 @@ static int s2255_start_acquire(struct s2255_vc *vc) ...@@ -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); dprintk(dev, 2, "start acquire exit[%d] %d\n", vc->idx, res);
mutex_unlock(&dev->cmdlock); mutex_unlock(&dev->cmdlock);
return 0; return res;
} }
static int s2255_stop_acquire(struct s2255_vc *vc) static int s2255_stop_acquire(struct s2255_vc *vc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment