From: Florian Echtler Date: Tue, 31 May 2016 20:15:33 +0000 (-0300) Subject: sur40: fix occasional oopses on device close X-Git-Tag: firefly_0821_release~176^2~4^2~31^2~408 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=1fe16eaeb94068fbe002ec75cb4799a2474108fd;p=firefly-linux-kernel-4.4.55.git sur40: fix occasional oopses on device close commit 6a8588156657e607fcfdffd46c1daae8ba88a1e5 upstream. Closing the V4L2 device sometimes triggers a kernel oops. Present patch fixes this. Signed-off-by: Martin Kaltenbrunner Signed-off-by: Florian Echtler Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c index 07a262bddf57..45b466e3bbe8 100644 --- a/drivers/input/touchscreen/sur40.c +++ b/drivers/input/touchscreen/sur40.c @@ -441,7 +441,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 */ v4l2_get_timestamp(&new_buf->vb.timestamp); @@ -730,6 +730,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 */