summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2004-01-22 10:48:47 +0000
committerMichael Hunold <devnull@localhost>2004-01-22 10:48:47 +0000
commit6043a84353b60f3e999b6a226296beaf2b2c742e (patch)
tree66508bf227664c14ba25fdc3078410d1a01f8354 /linux/drivers
parent7ea5519a6ea55cb4cbef26ae2f8e71054fe0f188 (diff)
downloadmediapointer-dvb-s2-6043a84353b60f3e999b6a226296beaf2b2c742e.tar.gz
mediapointer-dvb-s2-6043a84353b60f3e999b6a226296beaf2b2c742e.tar.bz2
- don't allocate ARM_PACKET_SIZE (= 4096(!) bytes) on the stack, use
kmalloc() instead (found by Dave Jones on lkml, Alex please review)
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
index 8ac689e17..7721c1735 100644
--- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
+++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c
@@ -1188,7 +1188,7 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
0x00, 0x00, 0x00, 0x00,
0x61, 0x00 };
u8 b1[] = { 0x61 };
- u8 b[ARM_PACKET_SIZE];
+ u8 *b;
char idstring[21];
u8 *firmware = NULL;
size_t firmware_size = 0;
@@ -1270,6 +1270,10 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
trans_count = 0;
j = 0;
+ b = kmalloc(ARM_PACKET_SIZE, GFP_KERNEL);
+ if (b == NULL)
+ return -ENOMEM;
+
for (i = 0; i < firmware_size; i += COMMAND_PACKET_SIZE) {
size = firmware_size - i;
if (size > COMMAND_PACKET_SIZE)
@@ -1297,6 +1301,8 @@ static int ttusb_dec_boot_dsp(struct ttusb_dec *dec)
result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
+ kfree(b);
+
return result;
}