aboutsummaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/sur40.c
diff options
context:
space:
mode:
authorFlorian Echtler2016-05-31 17:15:33 -0300
committerMauro Carvalho Chehab2016-07-08 16:16:57 -0300
commit6a8588156657e607fcfdffd46c1daae8ba88a1e5 (patch)
treee220f9c529f8bb08c6e8990071cc691ba2856579 /drivers/input/touchscreen/sur40.c
parentaf766ee005c496b8567976dc3eed7676443ed6de (diff)
[media] sur40: fix occasional oopses on device close
Closing the V4L2 device sometimes triggers a kernel oops. Present patch fixes this. Signed-off-by: Martin Kaltenbrunner <modin@yuri.at> Signed-off-by: Florian Echtler <floe@butterbrot.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: <stable@vger.kernel.org> # for v4.2 and up Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/input/touchscreen/sur40.c')
-rw-r--r--drivers/input/touchscreen/sur40.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
index bff525f26e87..b2f3d266dd17 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -447,7 +447,7 @@ static void sur40_process_video(struct sur40_state *sur40)
/* return error if streaming was stopped in the meantime */
if (sur40->sequence == -1)
- goto err_poll;
+ return;
/* mark as finished */
new_buf->vb.vb2_buf.timestamp = ktime_get_ns();
@@ -725,6 +725,7 @@ static int sur40_start_streaming(struct vb2_queue *vq, unsigned int count)
static void sur40_stop_streaming(struct vb2_queue *vq)
{
struct sur40_state *sur40 = vb2_get_drv_priv(vq);
+ vb2_wait_for_all_buffers(vq);
sur40->sequence = -1;
/* Release all active buffers */