[IBAL] Fixed bug where a call to al_cep_listen with a CEP in CEP_STATE_PRE_REQ
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 12 Sep 2005 18:07:43 +0000 (18:07 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 12 Sep 2005 18:07:43 +0000 (18:07 +0000)
would free the MAD allocated in al_cep_pre_req, but not change the state.
If al_cep_listen fails, the state wouldn't be changed to reflect that the MAD
was returned and a subsequent call would attempt to free a NULL MAD.

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@62 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/al/kernel/al_cm_cep.c

index b99e168..c563969 100644 (file)
@@ -3964,6 +3964,8 @@ al_cep_listen(
                CL_ASSERT( p_cep->p_mad );\r
                ib_put_mad( p_cep->p_mad );\r
                p_cep->p_mad = NULL;\r
+               /* Must change state here in case listen fails */\r
+               p_cep->state = CEP_STATE_IDLE;\r
                /* Fall through. */\r
        case CEP_STATE_IDLE:\r
                break;\r