Greg: I hope this will deal with your objection.  It applies on top of all the
previous patches (including the one that puts the sk_buff on the stack in
the first place).  If you like, I can rediff them.

  speedtouch: don't allocate a struct sk_buff on the stack anymore:
  use two pointers and a tweak to atmsar_decode_rawcell instead.
  This is another temporary hack until I find time to rework
  atmsar_decode_rawcell properly.


 atmsar.c     |    5 ++---
 speedtouch.c |   18 ++++++++++++------
 2 files changed, 14 insertions(+), 9 deletions(-)


diff -Nru a/drivers/usb/misc/atmsar.c b/drivers/usb/misc/atmsar.c
--- a/drivers/usb/misc/atmsar.c Wed Jan 29 15:29:11 2003
+++ b/drivers/usb/misc/atmsar.c Wed Jan 29 15:29:11 2003
@@ -624,9 +624,8 @@
                } else {
                        /* If data is corrupt and skb doesn't hold a whole cell, flush 
the lot */
                        if (skb_pull (skb, (list->flags & ATMSAR_USE_53BYTE_CELL ? 53 
: 52)) ==
-                           NULL) {
-                               skb_trim (skb, 0);
-                       }
+                           NULL)
+                               return NULL;
                }
        }
 
diff -Nru a/drivers/usb/misc/speedtouch.c b/drivers/usb/misc/speedtouch.c
--- a/drivers/usb/misc/speedtouch.c     Wed Jan 29 15:29:11 2003
+++ b/drivers/usb/misc/speedtouch.c     Wed Jan 29 15:29:11 2003
@@ -243,7 +243,8 @@
        struct udsl_instance_data *instance = (struct udsl_instance_data *) data;
        struct udsl_receiver *rcv;
        unsigned long flags;
-       struct sk_buff skb;
+       unsigned char *data_start;
+       struct sk_buff *skb;
        struct urb *urb;
        struct atmsar_vcc_data *atmsar_vcc = NULL;
        struct sk_buff *new = NULL, *tmp = NULL;
@@ -264,14 +265,16 @@
                        PDEBUG ("udsl_process_receive: processing urb with rcv %p, urb 
%p, skb %p\n", rcv, urb, rcv->skb);
 
                        /* update the skb structure */
-                       skb = *rcv->skb;
-                       skb_put (&skb, urb->actual_length);
+                       skb = rcv->skb;
+                       skb_trim (skb, 0);
+                       skb_put (skb, urb->actual_length);
+                       data_start = skb->data;
 
-                       PDEBUG ("skb->len = %d\n", skb.len);
-                       PACKETDEBUG (skb.data, skb.len);
+                       PDEBUG ("skb->len = %d\n", skb->len);
+                       PACKETDEBUG (skb->data, skb->len);
 
                        while ((new =
-                               atmsar_decode_rawcell (instance->atmsar_vcc_list, &skb,
+                               atmsar_decode_rawcell (instance->atmsar_vcc_list, skb,
                                                       &atmsar_vcc)) != NULL) {
                                PDEBUG ("(after cell processing)skb->len = %d\n", 
new->len);
 
@@ -306,6 +309,9 @@
                                        break;
                                }
                        }
+
+                       /* restore skb */
+                       skb_push (skb, skb->data - data_start);
 
                        usb_fill_bulk_urb (urb,
                                           instance->usb_dev,



-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to