diff options
author | Anssi Hannula <anssi.hannula@gmail.com> | 2005-07-07 20:57:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-07-07 21:23:54 -0400 |
commit | 0c744b010078bd65724477e75261e51712d290a0 (patch) | |
tree | 7d504d2e4d3d9a832a8df55eef3b4edc07acee18 /drivers/media/dvb/ttusb-dec | |
parent | 3faadbb0fde3c53e1c4f13eabb478c0c7cb1e4dd (diff) |
[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.c | 11 |
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) | |||
1281 | if (firmware_size < 60) { | 1281 | if (firmware_size < 60) { |
1282 | printk("%s: firmware size too small for DSP code (%zu < 60).\n", | 1282 | printk("%s: firmware size too small for DSP code (%zu < 60).\n", |
1283 | __FUNCTION__, firmware_size); | 1283 | __FUNCTION__, firmware_size); |
1284 | release_firmware(fw_entry); | ||
1284 | return -1; | 1285 | return -1; |
1285 | } | 1286 | } |
1286 | 1287 | ||
@@ -1294,6 +1295,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec) | |||
1294 | printk("%s: crc32 check of DSP code failed (calculated " | 1295 | printk("%s: crc32 check of DSP code failed (calculated " |
1295 | "0x%08x != 0x%08x in file), file invalid.\n", | 1296 | "0x%08x != 0x%08x in file), file invalid.\n", |
1296 | __FUNCTION__, crc32_csum, crc32_check); | 1297 | __FUNCTION__, crc32_csum, crc32_check); |
1298 | release_firmware(fw_entry); | ||
1297 | return -1; | 1299 | return -1; |
1298 | } | 1300 | } |
1299 | memcpy(idstring, &firmware[36], 20); | 1301 | memcpy(idstring, &firmware[36], 20); |
@@ -1308,15 +1310,19 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec) | |||
1308 | 1310 | ||
1309 | result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL); | 1311 | result = ttusb_dec_send_command(dec, 0x41, sizeof(b0), b0, NULL, NULL); |
1310 | 1312 | ||
1311 | if (result) | 1313 | if (result) { |
1314 | release_firmware(fw_entry); | ||
1312 | return result; | 1315 | return result; |
1316 | } | ||
1313 | 1317 | ||
1314 | trans_count = 0; | 1318 | trans_count = 0; |
1315 | j = 0; | 1319 | j = 0; |
1316 | 1320 | ||
1317 | b = kmalloc(ARM_PACKET_SIZE, GFP_KERNEL); | 1321 | b = kmalloc(ARM_PACKET_SIZE, GFP_KERNEL); |
1318 | if (b == NULL) | 1322 | if (b == NULL) { |
1323 | release_firmware(fw_entry); | ||
1319 | return -ENOMEM; | 1324 | return -ENOMEM; |
1325 | } | ||
1320 | 1326 | ||
1321 | for (i = 0; i < firmware_size; i += COMMAND_PACKET_SIZE) { | 1327 | for (i = 0; i < firmware_size; i += COMMAND_PACKET_SIZE) { |
1322 | size = firmware_size - i; | 1328 | size = firmware_size - i; |
@@ -1345,6 +1351,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec) | |||
1345 | 1351 | ||
1346 | result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL); | 1352 | result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL); |
1347 | 1353 | ||
1354 | release_firmware(fw_entry); | ||
1348 | kfree(b); | 1355 | kfree(b); |
1349 | 1356 | ||
1350 | return result; | 1357 | return result; |