Sorry for my abbreviated late night style. By "yes it is" I meant that the CL_ASSERT is really mapping to no op in non debug version. By "I do not think it is required" I mean that if we have the new "if" we do not need the CL_ASSERT.
Eitan > RE:[PATCH]OpenSM/osm_ucast_updn.c::__updn_create_updn_next_step_tFix NULL > ptrissue > > On Wed, 2006-05-24 at 16:41, Eitan Zahavi wrote: > > > But isn't CL_ASSERT a debug compile time thing so it's needed when > > it's > > > built without debug ? > > Yes it is - but I do not think it is required. > > I don't understand what you wrote. > > Does "yes it is" mean that you agree it is a debug compile time thing ? > > Why is it not required ? What if the memory allocation fails ? > > -- Hal > > > > > > > > > > > You missed the line that asserts on null p_next_step just before the > > > > code you changed . > > > > > > > > > -- Hal > > > > > > > . > > > > > > > > EZ > > > > > > > > Eitan Zahavi > > > > Senior Engineering Director, Software Architect > > > > Mellanox Technologies LTD > > > > Tel:+972-4-9097208 > > > > Fax:+972-4-9593245 > > > > P.O. Box 586 Yokneam 20692 ISRAEL > > > > > > > > > > > > > -----Original Message----- > > > > > From: Hal Rosenstock [mailto:[EMAIL PROTECTED] > > > > > Sent: Wednesday, May 24, 2006 4:34 PM > > > > > To: [email protected] > > > > > Cc: Eitan Zahavi > > > > > Subject: [PATCH] > > > > OpenSM/osm_ucast_updn.c::__updn_create_updn_next_step_tFix > > > > > NULL ptr issue > > > > > > > > > > OpenSM/osm_ucast_updn.c::__updn_create_updn_next_step_t Fix NULL > > ptr > > > > > issue > > > > > > > > > > Signed-off-by: Hal Rosenstock <[EMAIL PROTECTED]> > > > > > > > > > > Index: opensm/osm_ucast_updn.c > > > > > > > =================================================================== > > > > > --- opensm/osm_ucast_updn.c (revision 7435) > > > > > +++ opensm/osm_ucast_updn.c (working copy) > > > > > @@ -121,10 +121,12 @@ __updn_create_updn_next_step_t(IN updn_s > > > > > 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; > > > > > - > > > > > } > > > > > > > > > > > > > > > > /********************************************************************** > > > > > > > > > _______________________________________________ openib-general mailing list [email protected] http://openib.org/mailman/listinfo/openib-general To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
