From: Andrew Morton Date: Tue, 17 Apr 2007 05:53:25 +0000 (-0700) Subject: drivers/macintosh/smu.c: fix locking snafu X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=94256dd680f837dc14dd7d1377c5326fb3362721;p=linux-beck.git drivers/macintosh/smu.c: fix locking snafu It got its lock and unlock backwards. Fixes http://bugzilla.kernel.org/show_bug.cgi?id=8334 (obviously, this code could be using plain old spin_lock_irq(), too) Cc: Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c index 3096836d8bd3..c9f3dc4fd3ee 100644 --- a/drivers/macintosh/smu.c +++ b/drivers/macintosh/smu.c @@ -1259,9 +1259,9 @@ static int smu_release(struct inode *inode, struct file *file) set_current_state(TASK_UNINTERRUPTIBLE); if (pp->cmd.status != 1) break; - spin_lock_irqsave(&pp->lock, flags); - schedule(); spin_unlock_irqrestore(&pp->lock, flags); + schedule(); + spin_lock_irqsave(&pp->lock, flags); } set_current_state(TASK_RUNNING); remove_wait_queue(&pp->wait, &wait);