Skip to content

Commit

Permalink
sound: Add missing spin_unlock
Browse files Browse the repository at this point in the history
Add a spin_unlock missing on the error path.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression E1;
@@

* spin_lock(E1,...);
  <+... when != E1
  if (...) {
    ... when != E1
*   return ...;
  }
  ...+>
* spin_unlock(E1,...);
// </smpl>

Signed-off-by: Julia Lawall <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
Julia Lawall authored and tiwai committed May 27, 2010
1 parent 4daf7a0 commit 1efddcc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions sound/mips/au1x00.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,7 @@ get the interrupt driven case to work efficiently */
break;
if (i == 0x5000) {
printk(KERN_ERR "au1000 AC97: AC97 command read timeout\n");
spin_unlock(&au1000->ac97_lock);
return 0;
}

Expand Down
5 changes: 3 additions & 2 deletions sound/oss/dmasound/dmasound_atari.c
Original file line number Diff line number Diff line change
Expand Up @@ -1277,15 +1277,15 @@ static irqreturn_t AtaInterrupt(int irq, void *dummy)
* (almost) like on the TT.
*/
write_sq_ignore_int = 0;
return IRQ_HANDLED;
goto out;
}

if (!write_sq.active) {
/* playing was interrupted and sq_reset() has already cleared
* the sq variables, so better don't do anything here.
*/
WAKE_UP(write_sq.sync_queue);
return IRQ_HANDLED;
goto out;
}

/* Probably ;) one frame is finished. Well, in fact it may be that a
Expand Down Expand Up @@ -1322,6 +1322,7 @@ static irqreturn_t AtaInterrupt(int irq, void *dummy)
/* We are not playing after AtaPlay(), so there
is nothing to play any more. Wake up a process
waiting for audio output to drain. */
out:
spin_unlock(&dmasound.lock);
return IRQ_HANDLED;
}
Expand Down

0 comments on commit 1efddcc

Please sign in to comment.