V4L/DVB (5073): Fix OOPS on some waitqueue conditions
authorMauro Carvalho Chehab <mchehab@infradead.org>
Sat, 13 Jan 2007 12:25:16 +0000 (09:25 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 21 Feb 2007 15:34:21 +0000 (13:34 -0200)
If for some reason vivi_thread() fails, vivi will suffer an OOPS at
thread stop code, since waitqueue wouldn't be properly initializated.

Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/vivi.c

index cfb6b1f0402c0e24885f37b9ad9adcd5a22e0bd3..119cfd5ce312bacb160663b0da0e79a326a4d5f5 100644 (file)
@@ -538,7 +538,6 @@ static int vivi_start_thread(struct vivi_dmaqueue  *dma_q)
        dma_q->ini_jiffies=jiffies;
 
        dprintk(1,"%s\n",__FUNCTION__);
-       init_waitqueue_head(&dma_q->wq);
 
        dma_q->kthread = kthread_run(vivi_thread, dma_q, "vivi");
 
@@ -1352,6 +1351,7 @@ static int __init vivi_init(void)
        /* init video dma queues */
        INIT_LIST_HEAD(&dev->vidq.active);
        INIT_LIST_HEAD(&dev->vidq.queued);
+       init_waitqueue_head(&dev->vidq.wq);
 
        /* initialize locks */
        init_MUTEX(&dev->lock);