Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-08-16 22:01:45 +0200
committerJiri Slaby <jslaby@suse.cz>2019-08-16 22:25:10 +0200
commitccdbfec289fa0bc6c0cc50e7a627b49c9145663c (patch)
tree4c6d9d055e8c54dfb2c9e34a7a8c0e7e041fd6a4
parent82ea3ef058a617a5eb27cdd3a4fc1109e4ffde63 (diff)
ALSA: usb-audio: fix a memory leak bug (bnc#1012628).
-rw-r--r--patches.kernel.org/5.2.9-119-ALSA-usb-audio-fix-a-memory-leak-bug.patch41
-rw-r--r--series.conf1
2 files changed, 42 insertions, 0 deletions
diff --git a/patches.kernel.org/5.2.9-119-ALSA-usb-audio-fix-a-memory-leak-bug.patch b/patches.kernel.org/5.2.9-119-ALSA-usb-audio-fix-a-memory-leak-bug.patch
new file mode 100644
index 0000000000..e95cb4755c
--- /dev/null
+++ b/patches.kernel.org/5.2.9-119-ALSA-usb-audio-fix-a-memory-leak-bug.patch
@@ -0,0 +1,41 @@
+From: Wenwen Wang <wenwen@cs.uga.edu>
+Date: Tue, 6 Aug 2019 03:00:27 -0400
+Subject: [PATCH] ALSA: usb-audio: fix a memory leak bug
+References: bnc#1012628
+Patch-mainline: 5.2.9
+Git-commit: a67060201b746a308b1674f66bf289c9faef6d09
+
+commit a67060201b746a308b1674f66bf289c9faef6d09 upstream.
+
+In snd_usb_get_audioformat_uac3(), a structure for channel maps 'chmap' is
+allocated through kzalloc() before the execution goto 'found_clock'.
+However, this structure is not deallocated if the memory allocation for
+'pd' fails, leading to a memory leak bug.
+
+To fix the above issue, free 'fp->chmap' before returning NULL.
+
+Fixes: 7edf3b5e6a45 ("ALSA: usb-audio: AudioStreaming Power Domain parsing")
+Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Jiri Slaby <jslaby@suse.cz>
+---
+ sound/usb/stream.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/sound/usb/stream.c b/sound/usb/stream.c
+index 7ee9d17d0143..e852c7fd6109 100644
+--- a/sound/usb/stream.c
++++ b/sound/usb/stream.c
+@@ -1043,6 +1043,7 @@ snd_usb_get_audioformat_uac3(struct snd_usb_audio *chip,
+
+ pd = kzalloc(sizeof(*pd), GFP_KERNEL);
+ if (!pd) {
++ kfree(fp->chmap);
+ kfree(fp->rate_table);
+ kfree(fp);
+ return NULL;
+--
+2.22.0
+
diff --git a/series.conf b/series.conf
index 1c883d6d26..6cd2c59e2f 100644
--- a/series.conf
+++ b/series.conf
@@ -1139,6 +1139,7 @@
patches.kernel.org/5.2.9-116-s390-dma-provide-proper-ARCH_ZONE_DMA_BITS-valu.patch
patches.kernel.org/5.2.9-117-gen_compile_commands-lower-the-entry-count-thre.patch
patches.kernel.org/5.2.9-118-HID-sony-Fix-race-condition-between-rumble-and-.patch
+ patches.kernel.org/5.2.9-119-ALSA-usb-audio-fix-a-memory-leak-bug.patch
########################################################
# Build fixes that apply to the vanilla kernel too.