Commit bf0be0e951cf1c4c9ce38032195cd8095a16d828

Authored by Jesper Juhl
Committed by Takashi Iwai
1 parent 46f2cc8051

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: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

sound/usb/6fire/firmware.c
... ... @@ -227,6 +227,7 @@
227 227 ret = usb6fire_fw_ihex_init(fw, rec);
228 228 if (ret < 0) {
229 229 kfree(rec);
  230 + release_firmware(fw);
230 231 snd_printk(KERN_ERR PREFIX "error validating ezusb "
231 232 "firmware %s.\n", fwname);
232 233 return ret;