linux/sound
Kelly Anderson 12ff414e2e ALSA: pcm: fix infinite loop in snd_pcm_update_hw_ptr0()
When period interrupts are disabled, snd_pcm_update_hw_ptr0() compares
the current time against the time estimated for the current hardware
pointer to detect xruns.  The somewhat fuzzy threshold in the while loop
makes it possible that hdelta becomes negative; the comparison being
done with unsigned types then makes the loop go through the entire 263
negative range, and, depending on the value, never reach an unsigned
value that is small enough to stop the loop.  Doing this with interrupts
disabled results in the machine locking up.

To prevent this, ensure that the loop condition uses signed types for
both operands so that the comparison is correctly done.

Many thanks to Kelly Anderson for debugging this.

Reported-by: Nix <nix@esperi.org.uk>
Reported-by: "Christopher K." <c.krooss@googlemail.com>
Reported-and-tested-by: Kelly Anderson <kelly@silka.with-linux.com>
Signed-off-by: Kelly Anderson <kelly@silka.with-linux.com>
[cl: remove unneeded casts; use a temp variable]
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: 2.6.38 <stable@kernel.org>

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-04-01 18:01:23 +02:00
..
aoa
arm Merge branches 'aaci', 'mmci-dma', 'pl' and 'pl011' into drivers 2011-03-17 11:04:51 +00:00
atmel ALSA: fix invalid hardware.h include in ac97c for AVR32 architecture 2011-01-25 18:07:10 +01:00
core ALSA: pcm: fix infinite loop in snd_pcm_update_hw_ptr0() 2011-04-01 18:01:23 +02:00
drivers ALSA: aloop - Fix possible IRQ lock inversion 2011-03-18 07:31:53 +01:00
firewire ALSA: firewire-speakers: fix hang when unplugging a running device 2011-03-30 08:56:57 +02:00
i2c
isa
mips
oss sound/oss/opl3: validate voice and channel indexes 2011-03-23 22:48:13 +01:00
parisc
pci ALSA: HDA: Add dock mic quirk for Lenovo Thinkpad X220 2011-03-31 20:28:33 +02:00
pcmcia ALSA: use linux/io.h to fix compile warnings 2011-02-02 17:49:53 +01:00
ppc ALSA: powermac - Allow input from microphone on Tumbler 2011-02-28 11:19:17 +01:00
sh
soc Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2011-03-24 09:50:13 -07:00
sparc dt/sound: Eliminate users of of_platform_{,un}register_driver 2011-02-28 13:22:44 -07:00
spi
synth
usb ALSA: usb-audio - Support for Boss JS-8 Jam Station 2011-03-23 22:51:38 +01:00
ac97_bus.c
Kconfig ALSA: add LaCie FireWire Speakers/Griffin FireWave Surround driver 2011-03-15 08:42:22 +01:00
last.c
Makefile ALSA: add LaCie FireWire Speakers/Griffin FireWave Surround driver 2011-03-15 08:42:22 +01:00
sound_core.c sound: Use sound_register_*() for additional OSS minor devices 2011-03-09 20:10:37 +01:00
sound_firmware.c sound: read i_size with i_size_read() 2011-03-18 15:14:57 +01:00