summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2011-05-30 12:49:01 +0200
committerTakashi Iwai <tiwai@suse.de>2011-06-02 19:56:31 +0200
commitbf0be0e951cf1c4c9ce38032195cd8095a16d828 (patch)
tree0f32e4bc1dd584e0f5e4cae2ceb7acdc0e74a61e /sound
parent46f2cc80514e389bacfb642a32a4181fa1f1d20b (diff)
downloadlinux-bf0be0e951cf1c4c9ce38032195cd8095a16d828.tar.bz2
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>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/6fire/firmware.c1
1 files changed, 1 insertions, 0 deletions
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;