[openib-general] [PATCHv2] OpenSM/osm_ucast_updn.c::__updn_create_updn_next_step_t: Fix NULL ptr issue

Hal Rosenstock halr at voltaire.com
Thu May 25 03:25:52 PDT 2006


OpenSM/osm_ucast_updn.c::__updn_create_updn_next_step_t: Fix NULL ptr
issue in non debug builds

Signed-off-by: Hal Rosenstock <halr at voltaire.com>

Index: opensm/osm_ucast_updn.c
===================================================================
--- opensm/osm_ucast_updn.c	(revision 7435)
+++ opensm/osm_ucast_updn.c	(working copy)
@@ -119,12 +119,12 @@ __updn_create_updn_next_step_t(IN updn_s
   updn_next_step_t *p_next_step;
 
   p_next_step = (updn_next_step_t*) cl_zalloc(sizeof(*p_next_step));
-  CL_ASSERT (p_next_step != NULL);
-
-  p_next_step->state = state;
-  p_next_step->p_sw = p_sw;
+  if (p_next_step)
+  {
+    p_next_step->state = state;
+    p_next_step->p_sw = p_sw;
+  }
   return p_next_step;
-
 }
 
 /**********************************************************************






More information about the general mailing list