Hi Hung, I will add the comment, while pushing the code.
/Neel. On Tuesday 29 March 2016 03:56 PM, Hung Nguyen wrote: > Hi Neel, > > Reviewed the patch. Ack from me. > Also please find my comments inline. > > BR, > Hung Nguyen - DEK Technologies > > -------------------------------------------------------------------------------- > From: Neelakanta reddyreddy.neelaka...@oracle.com > Sent: Tuesday, March 29, 2016 5:03PM > To: Zoran Milinkovic, Hung Nguyen > zoran.milinko...@ericsson.com,hung.d.ngu...@dektech.com.au > Cc: Opensaf-devel > opensaf-devel@lists.sourceforge.net > Subject: [PATCH 1 of 1] imm: honour return code when ncs_sel_obj_create is > called in imm initialize [#1713] > > > osaf/libs/agents/saf/imma/imma_init.c | 16 ++++++++++------ > 1 files changed, 10 insertions(+), 6 deletions(-) > > > diff --git a/osaf/libs/agents/saf/imma/imma_init.c > b/osaf/libs/agents/saf/imma/imma_init.c > --- a/osaf/libs/agents/saf/imma/imma_init.c > +++ b/osaf/libs/agents/saf/imma/imma_init.c > @@ -59,7 +59,7 @@ IMMA_CB imma_cb; > Code cloned from CkpSv. > **********************************************************************/ > > -static void imma_sync_with_immnd(IMMA_CB *cb) > +static uint32_t imma_sync_with_immnd(IMMA_CB *cb) > { > TRACE_ENTER(); > > @@ -68,11 +68,13 @@ static void imma_sync_with_immnd(IMMA_CB > if (cb->is_immnd_up) > { > m_NCS_UNLOCK(&cb->immnd_sync_lock,NCS_LOCK_WRITE); > - return; > + return NCSCC_RC_SUCCESS; > } > TRACE("Blocking first client"); > cb->immnd_sync_awaited = true; > - m_NCS_SEL_OBJ_CREATE(&cb->immnd_sync_sel); > + if(m_NCS_SEL_OBJ_CREATE(&cb->immnd_sync_sel) != NCSCC_RC_SUCCESS){ > + return NCSCC_RC_FAILURE; > > [Hung] We should unlock immnd_sync_lock before returning. > > + } > m_NCS_UNLOCK(&cb->immnd_sync_lock,NCS_LOCK_WRITE); > > /* Await indication from MDS saying IMMND is up */ > @@ -88,7 +90,7 @@ static void imma_sync_with_immnd(IMMA_CB > m_NCS_UNLOCK(&cb->immnd_sync_lock, NCS_LOCK_WRITE); > > TRACE_LEAVE(); > - return; > + return NCSCC_RC_SUCCESS; > } > > > @@ -162,8 +164,10 @@ static uint32_t imma_create(NCSMDS_SVC_I > goto mds_reg_fail; > } > > - imma_sync_with_immnd(cb); /* Needed to prevent endless TRY_AGAIN loop > - for first > client. */ > + if (imma_sync_with_immnd(cb) != NCSCC_RC_SUCCESS) { > + /* Needed to prevent endless TRY_AGAIN loop for first client. */ > + goto mds_reg_fail; > > [Hung] I think we should go to 'edu_init_fail' to call imma_mds_unregister(cb) > > + } > > /* EDU initialisation ABT: Dont exactly know why we need this but... */ > if (m_NCS_EDU_HDL_INIT(&cb->edu_hdl) != NCSCC_RC_SUCCESS) { > ------------------------------------------------------------------------------ Transform Data into Opportunity. Accelerate data analysis in your applications with Intel Data Analytics Acceleration Library. Click to learn more. http://pubads.g.doubleclick.net/gampad/clk?id=278785471&iu=/4140 _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel