
From: Dave Jones <davej@redhat.com>

Allocating 4KB on the stack can't be healthy.



---

 drivers/media/dvb/ttusb-dec/ttusb_dec.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletion(-)

diff -puN drivers/media/dvb/ttusb-dec/ttusb_dec.c~ttusb-stack-space-fix drivers/media/dvb/ttusb-dec/ttusb_dec.c
--- 25/drivers/media/dvb/ttusb-dec/ttusb_dec.c~ttusb-stack-space-fix	2004-01-21 12:24:08.000000000 -0800
+++ 25-akpm/drivers/media/dvb/ttusb-dec/ttusb_dec.c	2004-01-21 12:24:08.000000000 -0800
@@ -1146,7 +1146,7 @@ static int ttusb_dec_boot_dsp(struct ttu
 		    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;
@@ -1203,6 +1203,10 @@ static int ttusb_dec_boot_dsp(struct ttu
 	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)
@@ -1230,6 +1234,8 @@ static int ttusb_dec_boot_dsp(struct ttu
 
 	result = ttusb_dec_send_command(dec, 0x43, sizeof(b1), b1, NULL, NULL);
 
+	kfree(b);
+
 	return result;
 }
 

_
