[PATCH] TTUSB DVB: ttusb_boot_dsp() needs to release_firmware() orit leaks memory.

From: Jesper Juhl
Date: Sun Feb 06 2011 - 15:50:22 EST


In drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c:ttusb_boot_dsp() we
need to call release_firmware(fw) before returning or we'll leak - no
matter if we succeed or fail.

Signed-off-by: Jesper Juhl <jj@xxxxxxxxxxxxx>
---
dvb-ttusb-budget.c | 1 +
1 file changed, 1 insertion(+)

compile tested only.

diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
index 40625b2..cbe2f0d 100644
--- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
+++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
@@ -334,6 +334,7 @@ static int ttusb_boot_dsp(struct ttusb *ttusb)
err = ttusb_cmd(ttusb, b, 4, 0);

done:
+ release_firmware(fw);
if (err) {
dprintk("%s: usb_bulk_msg() failed, return value %i!\n",
__func__, err);

--
Jesper Juhl <jj@xxxxxxxxxxxxx> http://www.chaosbits.net/
Plain text mails only, please.
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/