Skip to content

Commit

Permalink
drivers/macintosh/smu.c: fix locking snafu
Browse files Browse the repository at this point in the history
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: <matthias.kaehlcke@gmail.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Apr 17, 2007
1 parent 07a0cfe commit 94256dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/macintosh/smu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 94256dd

Please sign in to comment.