]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.15.108/alsa-emu10k1-fix-capture-interrupt-handler-unlinking.patch
6.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 5.15.108 / alsa-emu10k1-fix-capture-interrupt-handler-unlinking.patch
1 From b09c551c77c7e01dc6e4f3c8bf06b5ffa7b06db5 Mon Sep 17 00:00:00 2001
2 From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
3 Date: Wed, 5 Apr 2023 22:12:20 +0200
4 Subject: ALSA: emu10k1: fix capture interrupt handler unlinking
5
6 From: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
7
8 commit b09c551c77c7e01dc6e4f3c8bf06b5ffa7b06db5 upstream.
9
10 Due to two copy/pastos, closing the MIC or EFX capture device would
11 make a running ADC capture hang due to unsetting its interrupt handler.
12 In principle, this would have also allowed dereferencing dangling
13 pointers, but we're actually rather thorough at disabling and flushing
14 the ints.
15
16 While it may sound like one, this actually wasn't a hypothetical bug:
17 PortAudio will open a capture stream at startup (and close it right
18 away) even if not asked to. If the first device is busy, it will just
19 proceed with the next one ... thus killing a concurrent capture.
20
21 Signed-off-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
22 Cc: <stable@vger.kernel.org>
23 Link: https://lore.kernel.org/r/20230405201220.2197923-1-oswald.buddenhagen@gmx.de
24 Signed-off-by: Takashi Iwai <tiwai@suse.de>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 ---
27 sound/pci/emu10k1/emupcm.c | 4 ++--
28 1 file changed, 2 insertions(+), 2 deletions(-)
29
30 --- a/sound/pci/emu10k1/emupcm.c
31 +++ b/sound/pci/emu10k1/emupcm.c
32 @@ -1236,7 +1236,7 @@ static int snd_emu10k1_capture_mic_close
33 {
34 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
35
36 - emu->capture_interrupt = NULL;
37 + emu->capture_mic_interrupt = NULL;
38 emu->pcm_capture_mic_substream = NULL;
39 return 0;
40 }
41 @@ -1344,7 +1344,7 @@ static int snd_emu10k1_capture_efx_close
42 {
43 struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
44
45 - emu->capture_interrupt = NULL;
46 + emu->capture_efx_interrupt = NULL;
47 emu->pcm_capture_efx_substream = NULL;
48 return 0;
49 }