Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);