[AX.25]: Fix unchecked nr_add_node uses.
authorRalf Baechle <ralf@linux-mips.org>
Thu, 14 Dec 2006 23:50:58 +0000 (15:50 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 18 Dec 2006 05:59:10 +0000 (21:59 -0800)
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/netrom/nr_route.c

index c6aa7aa03234d9243d262571b819cd400aeea18c..8f88964099ef05744db60430922c2e538ebffcc5 100644 (file)
@@ -779,9 +779,13 @@ int nr_route_frame(struct sk_buff *skb, ax25_cb *ax25)
        nr_src  = (ax25_address *)(skb->data + 0);
        nr_dest = (ax25_address *)(skb->data + 7);
 
-       if (ax25 != NULL)
-               nr_add_node(nr_src, "", &ax25->dest_addr, ax25->digipeat,
-                           ax25->ax25_dev->dev, 0, sysctl_netrom_obsolescence_count_initialiser);
+       if (ax25 != NULL) {
+               ret = nr_add_node(nr_src, "", &ax25->dest_addr, ax25->digipeat,
+                                 ax25->ax25_dev->dev, 0,
+                                 sysctl_netrom_obsolescence_count_initialiser);
+               if (ret)
+                       return ret;
+       }
 
        if ((dev = nr_dev_get(nr_dest)) != NULL) {      /* Its for me */
                if (ax25 == NULL)                       /* Its from me */
@@ -846,6 +850,7 @@ int nr_route_frame(struct sk_buff *skb, ax25_cb *ax25)
        ret = (nr_neigh->ax25 != NULL);
        nr_node_unlock(nr_node);
        nr_node_put(nr_node);
+
        return ret;
 }