summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorWenwen Wang <wang6495@umn.edu>2019-04-27 08:06:46 +0200
committerTakashi Iwai <tiwai@suse.de>2019-04-28 09:11:50 +0200
commitcb5173594d50c72b7bfa14113dfc5084b4d2f726 (patch)
tree7c1d80452f789d9024b4e2966236812fdc1bfb6b /block
parentALSA: gus: fix misuse of %x (diff)
downloadlinux-cb5173594d50c72b7bfa14113dfc5084b4d2f726.tar.xz
linux-cb5173594d50c72b7bfa14113dfc5084b4d2f726.zip
ALSA: usb-audio: Fix a memory leak bug
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>
Diffstat (limited to 'block')
0 files changed, 0 insertions, 0 deletions