patch-2.4.3 linux/drivers/net/appletalk/cops.c

Next file: linux/drivers/net/arcnet/Config.in
Previous file: linux/drivers/net/aironet4500_card.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/drivers/net/appletalk/cops.c linux/drivers/net/appletalk/cops.c
@@ -181,7 +181,7 @@
         int board;			/* Holds what board type is. */
 	int nodeid;			/* Set to 1 once have nodeid. */
         unsigned char node_acquire;	/* Node ID when acquired. */
-        struct at_addr node_addr;	/* Full node addres */
+        struct at_addr node_addr;	/* Full node address */
 };
 
 /* Index to functions, as function prototypes. */
@@ -752,8 +752,8 @@
 {
         int pkt_len = 0;
         int rsp_type = 0;
-        struct sk_buff *skb;
-        struct cops_local *lp = (struct cops_local *)dev->priv;
+        struct sk_buff *skb = NULL;
+        struct cops_local *lp = dev->priv;
         int ioaddr = dev->base_addr;
         int boguscount = 0;
         unsigned long flags;
@@ -771,6 +771,7 @@
                 /* Wait for DMA to turn around. */
                 while(++boguscount<1000000)
                 {
+			barrier();
                         if((inb(ioaddr+DAYNA_CARD_STATUS)&0x03)==DAYNA_RX_READY)
                                 break;
                 }
@@ -801,6 +802,7 @@
                 lp->stats.rx_dropped++;
                 while(pkt_len--)        /* Discard packet */
                         inb(ioaddr);
+		restore_flags(flags);
                 return;
         }
         skb->dev = dev;
@@ -820,7 +822,7 @@
 		printk(KERN_WARNING "%s: Bad packet length of %d bytes.\n", 
 			dev->name, pkt_len);
                 lp->stats.tx_errors++;
-                kfree_skb(skb);
+                dev_kfree_skb_any(skb);
                 return;
         }
 
@@ -828,7 +830,7 @@
         if(rsp_type == LAP_INIT_RSP)
         {	/* Nodeid taken from received packet. */
                 lp->node_acquire = skb->data[0];
-                kfree_skb(skb);
+                dev_kfree_skb_any(skb);
                 return;
         }
 
@@ -837,7 +839,7 @@
         {
                 printk(KERN_WARNING "%s: Bad packet type %d.\n", dev->name, rsp_type);
                 lp->stats.tx_errors++;
-                kfree_skb(skb);
+                dev_kfree_skb_any(skb);
                 return;
         }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)