]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.6.5/alsa-ctl-stop-notification-after-disconnection.patch
5.1-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.6.5 / alsa-ctl-stop-notification-after-disconnection.patch
1 From f388cdcdd160687c6650833f286b9c89c50960ff Mon Sep 17 00:00:00 2001
2 From: Takashi Iwai <tiwai@suse.de>
3 Date: Fri, 8 Jul 2016 08:05:19 +0200
4 Subject: ALSA: ctl: Stop notification after disconnection
5
6 From: Takashi Iwai <tiwai@suse.de>
7
8 commit f388cdcdd160687c6650833f286b9c89c50960ff upstream.
9
10 snd_ctl_remove() has a notification for the removal event. It's
11 superfluous when done during the device got disconnected. Although
12 the notification itself is mostly harmless, it may potentially be
13 harmful, and should be suppressed. Actually some components PCM may
14 free ctl elements during the disconnect or free callbacks, thus it's
15 no theoretical issue.
16
17 This patch adds the check of card->shutdown flag for avoiding
18 unnecessary notifications after (or during) the disconnect.
19
20 Signed-off-by: Takashi Iwai <tiwai@suse.de>
21 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22
23 ---
24 sound/core/control.c | 2 ++
25 1 file changed, 2 insertions(+)
26
27 --- a/sound/core/control.c
28 +++ b/sound/core/control.c
29 @@ -160,6 +160,8 @@ void snd_ctl_notify(struct snd_card *car
30
31 if (snd_BUG_ON(!card || !id))
32 return;
33 + if (card->shutdown)
34 + return;
35 read_lock(&card->ctl_files_rwlock);
36 #if IS_ENABLED(CONFIG_SND_MIXER_OSS)
37 card->mixer_oss_change_count++;