[openib-general] RE: [PATCH] [TRIVIAL] OpenSM/complib: Move assert before variable is used

Yael Kalka yael at mellanox.co.il
Wed Nov 30 22:41:15 PST 2005


Hi Hal,
This fix isn't correct, since you are asserting on a variable not yet
initialized.
Yael

-----Original Message-----
From: Hal Rosenstock [mailto:halr at voltaire.com]
Sent: Wednesday, November 30, 2005 11:04 PM
To: Yael Kalka
Cc: openib-general at openib.org
Subject: [PATCH] [TRIVIAL] OpenSM/complib: Move assert before variable
is used


OpenSM/complib: Move assert before variable is used

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

Index: cl_dispatcher.c
===================================================================
--- cl_dispatcher.c     (revision 4257)
+++ cl_dispatcher.c     (working copy)
@@ -344,8 +344,8 @@ cl_disp_post(
   cl_dispatcher_t    *p_disp;
   cl_disp_msg_t      *p_msg;
 
-  p_disp = handle->p_disp;
   CL_ASSERT( p_disp );
+  p_disp = handle->p_disp;
   CL_ASSERT( msg_id != CL_DISP_MSGID_NONE );
 
   cl_spinlock_acquire( &p_disp->lock );



More information about the general mailing list