summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-01-13 10:25:16 -0200
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-01-13 10:25:16 -0200
commitb656f853e151861432c6d828b44328711c64cc28 (patch)
tree677b9c67a705b6c2924e74f9890ecafdf0020c15 /linux
parenta7d752ebb538194f5c37a91e5c53cd6fd4d2106f (diff)
downloadmediapointer-dvb-s2-b656f853e151861432c6d828b44328711c64cc28.tar.gz
mediapointer-dvb-s2-b656f853e151861432c6d828b44328711c64cc28.tar.bz2
Fix OOPS on some waitqueue conditions
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/vivi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/linux/drivers/media/video/vivi.c b/linux/drivers/media/video/vivi.c
index e6f7d0fe1..30f70c0a1 100644
--- a/linux/drivers/media/video/vivi.c
+++ b/linux/drivers/media/video/vivi.c
@@ -594,7 +594,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);
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
dma_q->kthread = kthread_run(vivi_thread, dma_q, "vivi");
@@ -628,7 +627,8 @@ static void vivi_stop_thread(struct vivi_dmaqueue *dma_q)
/* shutdown control thread */
dma_q->notify = &sem;
dma_q->rmmod = 1;
- wake_up_interruptible(&dma_q->wq);
+ if (waitqueue_active(&dma_q->wq))
+ wake_up_interruptible(&dma_q->wq);
down(&sem);
dma_q->notify = NULL;
#else
@@ -1436,6 +1436,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);