diff options
author | Alex Woods <devnull@localhost> | 2004-03-24 17:12:10 +0000 |
---|---|---|
committer | Alex Woods <devnull@localhost> | 2004-03-24 17:12:10 +0000 |
commit | 8250323f790d06e8b930bcce9268b957fabfa1b1 (patch) | |
tree | 0c78967a3bc6e9b570faaa464ab5986189496c75 /linux/drivers/media/dvb/ttusb-dec | |
parent | c0b11ab2801cc759620e0b81f51a98cd7aa065c0 (diff) | |
download | mediapointer-dvb-s2-8250323f790d06e8b930bcce9268b957fabfa1b1.tar.gz mediapointer-dvb-s2-8250323f790d06e8b930bcce9268b957fabfa1b1.tar.bz2 |
Patch from Oliver Neukem to remove a buffer, since only one is used at a time.
Diffstat (limited to 'linux/drivers/media/dvb/ttusb-dec')
-rw-r--r-- | linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c index 591d05389..d15af99b4 100644 --- a/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c +++ b/linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c @@ -212,22 +212,15 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command, { int result, actual_len, i; u8 *b; - u8 *c; dprintk("%s\n", __FUNCTION__); b = kmalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL); if (!b) return -ENOMEM; - c = kmalloc(COMMAND_PACKET_SIZE + 4, GFP_KERNEL); - if (!c) { - kfree(b); - return -ENOMEM; - } if ((result = down_interruptible(&dec->usb_sem))) { kfree(b); - kfree(c); printk("%s: Failed to down usb semaphore.\n", __FUNCTION__); return result; } @@ -255,11 +248,10 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command, __FUNCTION__, result); up(&dec->usb_sem); kfree(b); - kfree(c); return result; } - result = usb_bulk_msg(dec->udev, dec->result_pipe, c, + result = usb_bulk_msg(dec->udev, dec->result_pipe, b, COMMAND_PACKET_SIZE + 4, &actual_len, HZ); if (result) { @@ -267,25 +259,23 @@ static int ttusb_dec_send_command(struct ttusb_dec *dec, const u8 command, __FUNCTION__, result); up(&dec->usb_sem); kfree(b); - kfree(c); return result; } else { if (debug) { printk("%s: result: ", __FUNCTION__); for (i = 0; i < actual_len; i++) - printk("0x%02X ", c[i]); + printk("0x%02X ", b[i]); printk("\n"); } if (result_length) - *result_length = c[3]; - if (cmd_result && c[3] > 0) - memcpy(cmd_result, &c[4], c[3]); + *result_length = b[3]; + if (cmd_result && b[3] > 0) + memcpy(cmd_result, &b[4], b[3]); up(&dec->usb_sem); kfree(b); - kfree(c); return 0; } } |