Skip to content

Commit

Permalink
ALSA: 6fire: Don't leak firmware in error path
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jesper Juhl authored and Takashi Iwai committed Jun 2, 2011
1 parent 46f2cc8 commit bf0be0e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/usb/6fire/firmware.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ static int usb6fire_fw_ezusb_upload(
ret = usb6fire_fw_ihex_init(fw, rec);
if (ret < 0) {
kfree(rec);
release_firmware(fw);
snd_printk(KERN_ERR PREFIX "error validating ezusb "
"firmware %s.\n", fwname);
return ret;
Expand Down

0 comments on commit bf0be0e

Please sign in to comment.