videobuf_qbuf: fix? possible videobuf_queue->stream corruption and lockup
PATCH 1/1 videobuf_qbuf: fix? possible videobuf_queue->stream corruption and lockup
I am pretty sure the bug is real, but the patch may be wrong, please review.
We are doing ->buf_prepare(buf) before adding buf to q->stream list. This means that videobuf_qbuf() should not try to re-add a STATE_PREPARED buffer.
drivers/media/video/video-buf.c renamed from drivers/media/video/video-buf.c~v4l_lockup +1 -0
@@ -700,6 +700,7 @@ videobuf_qbuf(struct videobuf_queue *q, goto done; }if (buf->state ==STATE_QUEUED || + buf->state ==STATE_PREPARED || buf->state ==STATE_ACTIVE ) {dprintk (1 ,"qbuf: buffer is already queued or active.\n" ); goto done;
Em Ter, 2007-01-23 às 20:57 +0300, Oleg Nesterov escreveu:
Quoted 6 lines
I am pretty sure the bug is real, but the patch may be wrong, please review.
We are doing ->buf_prepare(buf) before adding buf to
q->streamlist. This means thatvideobuf_qbuf()should not try to re-add aSTATE_PREPAREDbuffer.Signed-off-by Oleg Nesterov <[email protected]>
Chris/Adrian,
IMO, this should also be applied at -stable trees.
Quoted 12 lines
drivers/media/video/video-buf.c renamed from drivers/media/video/video-buf.c~v4l_lockup +1
-0@@ -700,6 +700,7 @@ videobuf_qbuf(struct videobuf_queue *q, goto done; }if (buf->state ==STATE_QUEUED || + buf->state ==STATE_PREPARED || buf->state ==STATE_ACTIVE ) {dprintk (1 ,"qbuf: buffer is already queued or active.\n" ); goto done;
Adrian Bunk
AppliedQuoted 6 lines · Mauro Carvalho Chehab
Em Ter, 2007-01-23 às 20:57 +0300, Oleg Nesterov escreveu:
Quoted 5 lines
I am pretty sure the bug is real, but the patch may be wrong, please review.
We are doing ->buf_prepare(buf) before adding buf to
q->streamlist. This means thatvideobuf_qbuf()should not try to re-add aSTATE_PREPAREDbuffer.
Quoted 7 lines
Quoted 1 line
Signed-off-by Oleg Nesterov <[email protected]>Signed-off-by Mauro Carvalho Chehab <[email protected]>Chris/Adrian,
IMO, this should also be applied at -stable trees.
...
Thanks, applied to 2.6.16 (a trivial backport was required since the dprintk() was added after 2.6.16).
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed