}\r
\r
*ph_fmr = h_fmr;\r
+ /* Release the reference taken in alloc_mlnx_fmr for initialization. */\r
deref_al_obj( &(*ph_fmr )->obj );\r
\r
AL_EXIT( AL_DBG_MR );\r
if( status != IB_SUCCESS )\r
{\r
//TODO: do we need to do something more about the error ?\r
- AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
+ AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
("unable to map FMR: %s\n", ib_get_err_str(status)) );\r
}\r
\r
if( status == IB_SUCCESS )\r
{\r
h_fmr->h_ci_fmr = NULL;\r
- /* We're good to destroy the object. */\r
+ /* We're good to destroy the object. \r
+ NOTE: No need to deref the al object , \r
+ we are reseting the fmr objb before inserting it back to the pool */\r
+ \r
h_fmr->obj.pfn_destroy( &h_fmr->obj, NULL );\r
+ }else{\r
+ deref_al_obj( &h_fmr->obj );\r
}\r
- deref_al_obj( &h_fmr->obj );\r
-\r
AL_EXIT( AL_DBG_MR );\r
return status;\r
}\r