Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: emu10k1: fix capture interrupt handler unlinking

Due to two copy/pastos, closing the MIC or EFX capture device would
make a running ADC capture hang due to unsetting its interrupt handler.
In principle, this would have also allowed dereferencing dangling
pointers, but we're actually rather thorough at disabling and flushing
the ints.

While it may sound like one, this actually wasn't a hypothetical bug:
PortAudio will open a capture stream at startup (and close it right
away) even if not asked to. If the first device is busy, it will just
proceed with the next one ... thus killing a concurrent capture.

Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20230405201220.2197923-1-oswald.buddenhagen@gmx.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Oswald Buddenhagen and committed by
Takashi Iwai
b09c551c f342ac00

+2 -2
+2 -2
sound/pci/emu10k1/emupcm.c
··· 1236 1236 { 1237 1237 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1238 1238 1239 - emu->capture_interrupt = NULL; 1239 + emu->capture_mic_interrupt = NULL; 1240 1240 emu->pcm_capture_mic_substream = NULL; 1241 1241 return 0; 1242 1242 } ··· 1344 1344 { 1345 1345 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream); 1346 1346 1347 - emu->capture_interrupt = NULL; 1347 + emu->capture_efx_interrupt = NULL; 1348 1348 emu->pcm_capture_efx_substream = NULL; 1349 1349 return 0; 1350 1350 }