Merge remote branch 'origin' into secretlab/next-devicetree
[safe/jmp/linux-2.6] / drivers / macintosh / smu.c
index ef1f333..2506c95 100644 (file)
@@ -1186,8 +1186,10 @@ static ssize_t smu_read_command(struct file *file, struct smu_private *pp,
                return -EOVERFLOW;
        spin_lock_irqsave(&pp->lock, flags);
        if (pp->cmd.status == 1) {
-               if (file->f_flags & O_NONBLOCK)
+               if (file->f_flags & O_NONBLOCK) {
+                       spin_unlock_irqrestore(&pp->lock, flags);
                        return -EAGAIN;
+               }
                add_wait_queue(&pp->wait, &wait);
                for (;;) {
                        set_current_state(TASK_INTERRUPTIBLE);