Skip to content

Commit

Permalink
V4L/DVB: dvb: siano: free spinlock before schedule()
Browse files Browse the repository at this point in the history
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 a934931.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Kulikov Vasiliy authored and Mauro Carvalho Chehab committed Aug 9, 2010
1 parent e03b984 commit d0a38ce
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/media/dvb/siano/smscoreapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d0a38ce

Please sign in to comment.