Commit bf0be0e9 authored by Jesper Juhl's avatar Jesper Juhl Committed by Takashi Iwai

ALSA: 6fire: Don't leak firmware in error path

One of the error paths in
sound/usb/6fire/firmware.c::usb6fire_fw_ezusb_upload() neglects to free
the memory allocated for the firmware before returning, thus leaking the
memory.
Signed-off-by: default avatarJesper Juhl <jj@chaosbits.net>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 46f2cc80
...@@ -227,6 +227,7 @@ static int usb6fire_fw_ezusb_upload( ...@@ -227,6 +227,7 @@ static int usb6fire_fw_ezusb_upload(
ret = usb6fire_fw_ihex_init(fw, rec); ret = usb6fire_fw_ihex_init(fw, rec);
if (ret < 0) { if (ret < 0) {
kfree(rec); kfree(rec);
release_firmware(fw);
snd_printk(KERN_ERR PREFIX "error validating ezusb " snd_printk(KERN_ERR PREFIX "error validating ezusb "
"firmware %s.\n", fwname); "firmware %s.\n", fwname);
return ret; return ret;
......
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