patch-2.4.6 linux/net/atm/lec.c

Next file: linux/net/atm/mpc.c
Previous file: linux/net/atm/common.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.5/linux/net/atm/lec.c linux/net/atm/lec.c
@@ -281,6 +281,10 @@
                                dev->name,
                                skb->len,skb->truesize);
                         nb=(unsigned char*)kmalloc(64, GFP_ATOMIC);
+                        if (nb == NULL) {
+                                dev_kfree_skb(skb);
+                                return 0;
+                        }
                         memcpy(nb,skb->data,skb->len);
                         kfree(skb->head);
                         skb->head = skb->data = nb;
@@ -1796,6 +1800,10 @@
         entry = lec_arp_find(priv, mac_addr);
         if (!entry) {
                 entry = make_entry(priv, mac_addr);
+                if (!entry) {
+                        lec_arp_unlock(priv);
+                        return;
+                }
                 entry->status = ESI_UNKNOWN;
                 lec_arp_put(priv->lec_arp_tables, entry);
                 /* Temporary, changes before end of function */
@@ -1890,6 +1898,10 @@
                         ioc_data->atm_addr[16],ioc_data->atm_addr[17],
                         ioc_data->atm_addr[18],ioc_data->atm_addr[19]);
                 entry = make_entry(priv, bus_mac);
+                if (entry == NULL) {
+                        lec_arp_unlock(priv);
+                        return;
+                }
                 memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN);
                 memset(entry->mac_addr, 0, ETH_ALEN);
                 entry->recv_vcc = vcc;
@@ -1967,6 +1979,10 @@
         /* Not found, snatch address from first data packet that arrives from
            this vcc */
         entry = make_entry(priv, bus_mac);
+        if (!entry) {
+                lec_arp_unlock(priv);
+                return;
+        }
         entry->vcc = vcc;
         entry->old_push = old_push;
         memcpy(entry->atm_addr, ioc_data->atm_addr, ATM_ESA_LEN);

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