summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/ttusb-dec
diff options
context:
space:
mode:
authorAnssi Hannula <anssi.hannula@gmail.com>2005-07-07 17:57:42 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-07-07 18:23:54 -0700
commit0c744b010078bd65724477e75261e51712d290a0 (patch)
tree7d504d2e4d3d9a832a8df55eef3b4edc07acee18 /drivers/media/dvb/ttusb-dec
parent3faadbb0fde3c53e1c4f13eabb478c0c7cb1e4dd (diff)
downloadtalos-obmc-linux-0c744b010078bd65724477e75261e51712d290a0.tar.gz
talos-obmc-linux-0c744b010078bd65724477e75261e51712d290a0.zip
[PATCH] dvb: add missing release_firmware() calls
Add missing release_firmware() calls to fix memory leaks. Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com> Signed-off-by: Johannes Stezenbach <js@linuxtv.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/dvb/ttusb-dec')
-rw-r--r--drivers/media/dvb/ttusb-dec/ttusb_dec.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index 505bdaff5a7e..45c9a9a08e4d 100644
--- a/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -1281,6 +1281,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
if (firmware_size < 60) {
printk("%s: firmware size too small for DSP code (%zu < 60).\n",
__FUNCTION__, firmware_size);
+ release_firmware(fw_entry);
return -1;
}
@@ -1294,6 +1295,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
printk("%s: crc32 check of DSP code failed (calculated "
"0x%08x != 0x%08x in file), file invalid.\n",
__FUNCTION__, crc32_csum, crc32_check);
+ release_firmware(fw_entry);
return -1;
}
memcpy(idstring, &firmware[36], 20);
@@ -1308,15 +1310,19 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL);
- if (result)
+ if (result) {
+ release_firmware(fw_entry);
return result;
+ }
trans_count = 0;
j = 0;
b = kmalloc(ARM_PACKET_SIZE, GFP_KERNEL);
- if (b == NULL)
+ if (b == NULL) {
+ release_firmware(fw_entry);
return -ENOMEM;
+ }
for (i = 0; i < firmware_size; i += COMMAND_PACKET_SIZE) {
size = firmware_size - i;
@@ -1345,6 +1351,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+ release_firmware(fw_entry);
kfree(b);
return result;
OpenPOWER on IntegriCloud