Commit 1fe16eae authored by Florian Echtler's avatar Florian Echtler Committed by Greg Kroah-Hartman

sur40: fix occasional oopses on device close

commit 6a858815 upstream.

Closing the V4L2 device sometimes triggers a kernel oops.
Present patch fixes this.
Signed-off-by: default avatarMartin Kaltenbrunner <modin@yuri.at>
Signed-off-by: default avatarFlorian Echtler <floe@butterbrot.org>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f8ad7cb6
......@@ -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 */
......
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