Commit d0a38ce2 authored by Kulikov Vasiliy's avatar Kulikov Vasiliy Committed by Mauro Carvalho Chehab

V4L/DVB: dvb: siano: free spinlock before schedule()

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 a9349315.
Signed-off-by: default avatarKulikov Vasiliy <segooon@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent e03b9843
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment