android_kernel_samsung_a7y1.../sound/usb
Wenwen Wang 123fc7a543 ALSA: usb-audio: Fix a memory leak bug
commit cb5173594d50c72b7bfa14113dfc5084b4d2f726 upstream.

In parse_audio_selector_unit(), the string array 'namelist' is allocated
through kmalloc_array(), and each string pointer in this array, i.e.,
'namelist[]', is allocated through kmalloc() in the following for loop.
Then, a control instance 'kctl' is created by invoking snd_ctl_new1(). If
an error occurs during the creation process, the string array 'namelist',
including all string pointers in the array 'namelist[]', should be freed,
before the error code ENOMEM is returned. However, the current code does
not free 'namelist[]', resulting in memory leaks.

To fix the above issue, free all string pointers 'namelist[]' in a loop.

Signed-off-by: Wenwen Wang <wang6495@umn.edu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-06 18:12:18 +02:00
..
6fire A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bcd2000 A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
caiaq A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
hiface A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
line6 ALSA: line6: use dynamic buffers 2020-04-06 16:41:48 +02:00
misc A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
usx2y A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
card.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
card.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
clock.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
clock.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
debug.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
endpoint.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
endpoint.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
format.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
format.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
helper.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
helper.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
midi.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
midi.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mixer_maps.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mixer_quirks.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mixer_quirks.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mixer_scarlett.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mixer_scarlett.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
mixer.c ALSA: usb-audio: Fix a memory leak bug 2020-04-06 18:12:18 +02:00
mixer.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pcm.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
pcm.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
power.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
proc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
proc.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
quirks-table.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
quirks.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
quirks.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
stream.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
stream.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
usbaudio.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30