Commit 7fbe3ca5 authored by Mariusz Kozlowski's avatar Mariusz Kozlowski Committed by Jaroslav Kysela

[ALSA] usb: usbmixer error path fix

Without the patch below namelist[0] will not be freed in case
of kmalloc error.
Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 8c670714
......@@ -1526,7 +1526,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, unsi
namelist[i] = kmalloc(MAX_ITEM_NAME_LEN, GFP_KERNEL);
if (! namelist[i]) {
snd_printk(KERN_ERR "cannot malloc\n");
while (--i > 0)
while (i--)
kfree(namelist[i]);
kfree(namelist);
kfree(cval);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment