V4L/DVB: dvb: siano: free spinlock before schedule()
authorKulikov Vasiliy <segooon@gmail.com>
Tue, 27 Jul 2010 18:42:40 +0000 (15:42 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 9 Aug 2010 02:43:06 +0000 (23:43 -0300)
Calling schedule() holding spinlock with disables irqs is improper. As
spinlock protects list coredev->buffers, it can be unlocked untill wakeup.
This bug was introduced in a9349315f65cd6a16e8fab1f6cf0fd40f379c4db.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/siano/smscoreapi.c

index 7f2c94a15ab14612c8239efc3933f6ea3597dac2..d93468cd3a85e1a5a3d8eee586c7ec29b69d3051 100644 (file)
@@ -1113,9 +1113,11 @@ struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev)
         */
 
        prepare_to_wait(&coredev->buffer_mng_waitq, &wait, TASK_INTERRUPTIBLE);
-
-       if (list_empty(&coredev->buffers))
+       if (list_empty(&coredev->buffers)) {
+               spin_unlock_irqrestore(&coredev->bufferslock, flags);
                schedule();
+               spin_lock_irqsave(&coredev->bufferslock, flags);
+       }
 
        finish_wait(&coredev->buffer_mng_waitq, &wait);