]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: remove superfluous checks after XMALLOC etc.
authorChristian Franke <chris@opensourcerouting.org>
Tue, 10 Nov 2015 17:04:44 +0000 (18:04 +0100)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 30 Mar 2016 00:26:13 +0000 (20:26 -0400)
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
isisd/isis_lsp.c
isisd/isis_route.c
isisd/isis_spf.c

index d0642ff5eb79ff4dc78470a5d19922c076d9435e..82554d13ce1a80ed5ec0ac3fb4cb06e049e74c5b 100644 (file)
@@ -579,12 +579,7 @@ lsp_new (u_char * lsp_id, u_int16_t rem_lifetime, u_int32_t seq_num,
   struct isis_lsp *lsp;
 
   lsp = XCALLOC (MTYPE_ISIS_LSP, sizeof (struct isis_lsp));
-  if (!lsp)
-    {
-      /* FIXME: set lspdbol bit */
-      zlog_warn ("lsp_new(): out of memory");
-      return NULL;
-    }
+
   /* FIXME: Should be minimal mtu? */
   lsp->pdu = stream_new (1500);
   if (LSP_FRAGMENT (lsp_id) == 0)
index 0e922566941029633cba06ccd884794408f8d73e..e72e0cac7afd03aacfca6b416f6bd0f9aa182dff 100644 (file)
@@ -67,10 +67,6 @@ isis_nexthop_create (struct in_addr *ip, unsigned int ifindex)
     }
 
   nexthop = XCALLOC (MTYPE_ISIS_NEXTHOP, sizeof (struct isis_nexthop));
-  if (!nexthop)
-    {
-      zlog_err ("ISIS-Rte: isis_nexthop_create: out of memory!");
-    }
 
   nexthop->ifindex = ifindex;
   memcpy (&nexthop->ip, ip, sizeof (struct in_addr));
@@ -139,10 +135,6 @@ isis_nexthop6_new (struct in6_addr *ip6, unsigned int ifindex)
   struct isis_nexthop6 *nexthop6;
 
   nexthop6 = XCALLOC (MTYPE_ISIS_NEXTHOP6, sizeof (struct isis_nexthop6));
-  if (!nexthop6)
-    {
-      zlog_err ("ISIS-Rte: isis_nexthop_create6: out of memory!");
-    }
 
   nexthop6->ifindex = ifindex;
   memcpy (&nexthop6->ip6, ip6, sizeof (struct in6_addr));
@@ -284,11 +276,6 @@ isis_route_info_new (struct prefix *prefix, uint32_t cost, uint32_t depth,
   struct listnode *node;
 
   rinfo = XCALLOC (MTYPE_ISIS_ROUTE_INFO, sizeof (struct isis_route_info));
-  if (!rinfo)
-    {
-      zlog_err ("ISIS-Rte: isis_route_info_new: out of memory!");
-      return NULL;
-    }
 
   if (prefix->family == AF_INET)
     {
@@ -424,12 +411,6 @@ isis_route_create (struct prefix *prefix, u_int32_t cost, u_int32_t depth,
   prefix2str (prefix, buff, sizeof (buff));
 
   rinfo_new = isis_route_info_new (prefix, cost, depth, adjacencies);
-  if (!rinfo_new)
-    {
-      zlog_err ("ISIS-Rte (%s): isis_route_create: out of memory!",
-               area->area_tag);
-      return NULL;
-    }
 
   if (family == AF_INET)
     route_node = route_node_get (area->route_table[level - 1], prefix);
index 81c1f457c0de79df243e0ff526f08880106623ae..84c89bf61e0b8c08ad42fd28b7b637187f0573f6 100644 (file)
@@ -189,11 +189,6 @@ isis_vertex_new (void *id, enum vertextype vtype)
   struct isis_vertex *vertex;
 
   vertex = XCALLOC (MTYPE_ISIS_VERTEX, sizeof (struct isis_vertex));
-  if (vertex == NULL)
-    {
-      zlog_err ("isis_vertex_new Out of memory!");
-      return NULL;
-    }
 
   vertex->type = vtype;
   switch (vtype)