aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2011-05-30 06:49:01 -0400
committerTakashi Iwai <tiwai@suse.de>2011-06-02 13:56:31 -0400
commitbf0be0e951cf1c4c9ce38032195cd8095a16d828 (patch)
tree0f32e4bc1dd584e0f5e4cae2ceb7acdc0e74a61e /sound
parent46f2cc80514e389bacfb642a32a4181fa1f1d20b (diff)
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(
227 ret = usb6fire_fw_ihex_init(fw, rec); 227 ret = usb6fire_fw_ihex_init(fw, rec);
228 if (ret < 0) { 228 if (ret < 0) {
229 kfree(rec); 229 kfree(rec);
230 release_firmware(fw);
230 snd_printk(KERN_ERR PREFIX "error validating ezusb " 231 snd_printk(KERN_ERR PREFIX "error validating ezusb "
231 "firmware %s.\n", fwname); 232 "firmware %s.\n", fwname);
232 return ret; 233 return ret;