patch-2.0.15 linux/drivers/isdn/icn/icn.c

Next file: linux/drivers/net/ibmtr.c
Previous file: linux/drivers/char/psaux.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.14/linux/drivers/isdn/icn/icn.c linux/drivers/isdn/icn/icn.c
@@ -687,6 +687,7 @@
 {
         int len = skb->len;
         unsigned long flags;
+        struct sk_buff *nskb;
 
         if (len > 4000) {
                 printk(KERN_WARNING
@@ -701,8 +702,14 @@
                 save_flags(flags);
                 cli();
                 card->sndcount[channel] += len;
-                skb_queue_tail(&card->spqueue[channel], skb);
+                nskb = skb_clone(skb, GFP_ATOMIC);
+                if (nskb) {
+                   skb_queue_tail(&card->spqueue[channel], nskb);
+                   dev_kfree_skb(skb, FREE_WRITE);
+                }
                 restore_flags(flags);
+                if (!nskb) 
+                   return 0;
         }
         return len;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov