Commit bec7fcac authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] err1-14: sb_audio locking fix

Lamely fix a straightforward deadlock in sb_audio.c.  Founf by the Stanford
locking checker.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c8c702b1
...@@ -519,9 +519,11 @@ static int sbpro_audio_prepare_for_output(int dev, int bsize, int bcount) ...@@ -519,9 +519,11 @@ static int sbpro_audio_prepare_for_output(int dev, int bsize, int bcount)
sb_dsp_command(devc, 0xa0 | bits); /* Mono output */ sb_dsp_command(devc, 0xa0 | bits); /* Mono output */
else else
sb_dsp_command(devc, 0xa8 | bits); /* Stereo output */ sb_dsp_command(devc, 0xa8 | bits); /* Stereo output */
spin_unlock_irqrestore(&devc->lock, flags);
} }
else else
{ {
spin_unlock_irqrestore(&devc->lock, flags);
tmp = sb_getmixer(devc, 0x0e); tmp = sb_getmixer(devc, 0x0e);
if (devc->channels == 1) if (devc->channels == 1)
tmp &= ~0x02; tmp &= ~0x02;
...@@ -529,7 +531,6 @@ static int sbpro_audio_prepare_for_output(int dev, int bsize, int bcount) ...@@ -529,7 +531,6 @@ static int sbpro_audio_prepare_for_output(int dev, int bsize, int bcount)
tmp |= 0x02; tmp |= 0x02;
sb_setmixer(devc, 0x0e, tmp); sb_setmixer(devc, 0x0e, tmp);
} }
spin_unlock_irqrestore(&devc->lock, flags);
devc->trigger_bits = 0; devc->trigger_bits = 0;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment