speedtouch: use an array for rcvbufs rather than a pointer and dynamic allocation.


 speedtouch.c |   16 +---------------
 1 files changed, 1 insertion(+), 15 deletions(-)


diff -Nru a/drivers/usb/misc/speedtouch.c b/drivers/usb/misc/speedtouch.c
--- a/drivers/usb/misc/speedtouch.c     Mon Jan 20 01:08:29 2003
+++ b/drivers/usb/misc/speedtouch.c     Mon Jan 20 01:08:29 2003
@@ -139,7 +139,7 @@
 
        /* usb device part */
        struct usb_device *usb_dev;
-       struct udsl_data_ctx *rcvbufs;
+       struct udsl_data_ctx rcvbufs [UDSL_NUMBER_RCV_URBS];
        struct sk_buff_head sndqueue;
        struct udsl_usb_send_data_context send_ctx [UDSL_NUMBER_SND_URBS];
        int data_started;
@@ -690,12 +690,6 @@
                usb_maxpacket (instance->usb_dev,
                               usb_sndbulkpipe (instance->usb_dev, 
UDSL_ENDPOINT_DATA_OUT), 0));
 
-       instance->rcvbufs = kmalloc (sizeof (struct udsl_data_ctx) * 
UDSL_NUMBER_RCV_URBS, GFP_KERNEL);
-       if (!instance->rcvbufs)
-               return -ENOMEM;
-
-       memset (instance->rcvbufs, 0, sizeof (struct udsl_data_ctx) * 
UDSL_NUMBER_RCV_URBS);
-
        skb_queue_head_init (&instance->sndqueue);
 
        for (i = 0, succes = 0; i < UDSL_NUMBER_RCV_URBS; i++) {
@@ -758,9 +752,6 @@
        if (!instance->data_started)
                return 0;
 
-       if (!instance->rcvbufs)
-               return 0;
-
        /* destroy urbs */
        for (i = 0; i < UDSL_NUMBER_RCV_URBS; i++) {
                struct udsl_data_ctx *ctx = &(instance->rcvbufs[i]);
@@ -790,10 +781,6 @@
 
        }
 
-       /* free receive contexts */
-       kfree (instance->rcvbufs);
-       instance->rcvbufs = NULL;
-
        instance->data_started = 0;
        instance->atm_dev->signal = ATM_PHY_SIG_LOST;
 
@@ -861,7 +848,6 @@
        /* initialize structure */
        memset (instance, 0, sizeof (struct udsl_instance_data));
        instance->usb_dev = dev;
-       instance->rcvbufs = NULL;
        tasklet_init (&instance->recvqueue_tasklet, udsl_atm_processqueue, (unsigned 
long) instance);
 
        udsl_atm_startdevice (instance, &udsl_atm_devops);



-------------------------------------------------------
This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your  SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to