Skip to content

Commit

Permalink
[ALSA] usb: usbmixer error path fix
Browse files Browse the repository at this point in the history
Without the patch below namelist[0] will not be freed in case
of kmalloc error.

Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
  • Loading branch information
Mariusz Kozlowski authored and Jaroslav Kysela committed Jan 9, 2007
1 parent 8c67071 commit 7fbe3ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/usb/usbmixer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7fbe3ca

Please sign in to comment.