LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] videobuf_qbuf: fix? possible videobuf_queue->stream corruption and lockup
@ 2007-01-23 17:57 Oleg Nesterov
  2007-01-23 23:10 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 3+ messages in thread
From: Oleg Nesterov @ 2007-01-23 17:57 UTC (permalink / raw)
  To: mchehab; +Cc: linux-kernel, Andrew Morton, Chris Wright

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.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

--- 6.19/drivers/media/video/video-buf.c~v4l_lockup	2006-11-17 19:42:25.000000000 +0300
+++ 6.19/drivers/media/video/video-buf.c	2007-01-23 19:44:19.000000000 +0300
@@ -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;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] videobuf_qbuf: fix? possible videobuf_queue->stream corruption and lockup
  2007-01-23 17:57 [PATCH] videobuf_qbuf: fix? possible videobuf_queue->stream corruption and lockup Oleg Nesterov
@ 2007-01-23 23:10 ` Mauro Carvalho Chehab
  2007-02-21 12:02   ` Adrian Bunk
  0 siblings, 1 reply; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2007-01-23 23:10 UTC (permalink / raw)
  To: Oleg Nesterov; +Cc: linux-kernel, Andrew Morton, Chris Wright, Adrian Bunk

Em Ter, 2007-01-23 às 20:57 +0300, Oleg Nesterov escreveu:
> 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.
> 
> Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

Chris/Adrian,

IMO, this should also be applied at -stable trees.
> 
> --- 6.19/drivers/media/video/video-buf.c~v4l_lockup	2006-11-17 19:42:25.000000000 +0300
> +++ 6.19/drivers/media/video/video-buf.c	2007-01-23 19:44:19.000000000 +0300
> @@ -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;
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] videobuf_qbuf: fix? possible videobuf_queue->stream corruption and lockup
  2007-01-23 23:10 ` Mauro Carvalho Chehab
@ 2007-02-21 12:02   ` Adrian Bunk
  0 siblings, 0 replies; 3+ messages in thread
From: Adrian Bunk @ 2007-02-21 12:02 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Oleg Nesterov, linux-kernel, Andrew Morton, Chris Wright

On Tue, Jan 23, 2007 at 09:10:08PM -0200, Mauro Carvalho Chehab wrote:
> Em Ter, 2007-01-23 às 20:57 +0300, Oleg Nesterov escreveu:
> > 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.
> > 
> > Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
> 
> 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

-- 

       "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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-21 12:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-23 17:57 [PATCH] videobuf_qbuf: fix? possible videobuf_queue->stream corruption and lockup Oleg Nesterov
2007-01-23 23:10 ` Mauro Carvalho Chehab
2007-02-21 12:02   ` Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).