All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dvb: siano: free spinlock before schedule()
@ 2010-07-27 18:42 ` Kulikov Vasiliy
  0 siblings, 0 replies; 10+ messages in thread
From: Kulikov Vasiliy @ 2010-07-27 18:42 UTC (permalink / raw)
  To: kernel-janitors
  Cc: Mauro Carvalho Chehab, Douglas Schilling Landgraf, Jiri Kosina,
	Roel Kluin, Andrew Morton, linux-media, linux-kernel

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>
---
 drivers/media/dvb/siano/smscoreapi.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/dvb/siano/smscoreapi.c b/drivers/media/dvb/siano/smscoreapi.c
index 7f2c94a..d93468c 100644
--- a/drivers/media/dvb/siano/smscoreapi.c
+++ b/drivers/media/dvb/siano/smscoreapi.c
@@ -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);
 
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-08-24 15:53 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-27 18:42 [PATCH] dvb: siano: free spinlock before schedule() Kulikov Vasiliy
2010-07-27 18:42 ` Kulikov Vasiliy
2010-07-27 22:24 ` Jiri Slaby
2010-07-27 22:24   ` Jiri Slaby
2010-08-08 16:10   ` Richard Zidlicky
2010-08-08 16:10     ` Richard Zidlicky
2010-08-24 12:52     ` Mauro Carvalho Chehab
2010-08-24 12:52       ` Mauro Carvalho Chehab
2010-08-24 15:43       ` Richard Zidlicky
2010-08-24 15:43         ` Richard Zidlicky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.