[<prev] [next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1103242141310.31709@swampdragon.chaosbits.net>
Date: Thu, 24 Mar 2011 21:44:34 +0100 (CET)
From: Jesper Juhl <jj@...osbits.net>
To: alsa-devel@...a-project.org
cc: linux-kernel@...r.kernel.org,
Torsten Schenk <torsten.schenk@...o.com>,
Takashi Iwai <tiwai@...e.de>, Jaroslav Kysela <perex@...ex.cz>
Subject: [PATCH] TerraTec DMX 6Fire USB: Don't leak firmware when
usb6fire_fw_ihex_init() fails.
We need to release_firmware() what we request_firmware()'ed when
usb6fire_fw_ihex_init() fails or we'll leak memory.
Signed-off-by: Jesper Juhl <jj@...osbits.net>
---
firmware.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sound/usb/6fire/firmware.c b/sound/usb/6fire/firmware.c
index 9081a54..2761392 100644
--- a/sound/usb/6fire/firmware.c
+++ b/sound/usb/6fire/firmware.c
@@ -254,6 +254,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;
--
Jesper Juhl <jj@...osbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/jargon/html/T/top-post.html
Plain text mails only, please.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists