From: Jesper Juhl Date: Mon, 30 May 2011 10:49:01 +0000 (+0200) Subject: ALSA: 6fire: Don't leak firmware in error path X-Git-Tag: v3.0-rc2~2^2~6 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=bf0be0e951cf1c4c9ce38032195cd8095a16d828;p=linux.git 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 Signed-off-by: Takashi Iwai --- diff --git a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c index d47beffedb0f..a91719d5918b 100644 --- a/sound/usb/6fire/firmware.c +++ b/sound/usb/6fire/firmware.c @@ -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;