android_kernel_oneplus_msm8998/sound/usb
Wenwen Wang 2d8956305a 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>
2019-06-11 12:23:35 +02:00
..
6fire
bcd2000
caiaq
hiface
line6 ALSA: line6: use dynamic buffers 2019-05-16 19:44:59 +02:00
misc
usx2y
card.c ALSA: usb-audio: Fix UAF decrement if card has no live interfaces in card.c 2018-12-13 09:21:36 +01:00
card.h
clock.c
clock.h
debug.h
endpoint.c
endpoint.h
format.c
format.h
helper.c
helper.h
Kconfig
Makefile
midi.c
midi.h
mixer.c ALSA: usb-audio: Fix a memory leak bug 2019-06-11 12:23:35 +02:00
mixer.h
mixer_maps.c ALSA: usb-audio: Skip broken EU on Dell dock USB-audio 2018-05-02 07:53:40 -07:00
mixer_quirks.c
mixer_quirks.h
mixer_scarlett.c
mixer_scarlett.h
pcm.c ALSA: usb-audio: Fix implicit fb endpoint setup by quirk 2019-02-20 10:13:22 +01:00
pcm.h
power.h
proc.c
proc.h
quirks-table.h ALSA: usb-audio: Fix an out-of-bound read in create_composite_quirks 2019-01-13 10:05:32 +01:00
quirks.c
quirks.h
stream.c
stream.h
usbaudio.h