status = ib_reg_mad_pool( gh_mad_pool, h_pd,\r
&((al_qp_alias_t*)h_qp)->pool_key );\r
if( status == IB_SUCCESS )\r
+ {\r
+ /*\r
+ * Take a reference on the pool key since we don't have a\r
+ * mechanism for the pool key to clear the QP's pointer to it.\r
+ */\r
+ ref_al_obj( &((al_qp_alias_t*)h_qp)->pool_key->obj );\r
*p_pool_key = ((al_qp_alias_t*)h_qp)->pool_key;\r
+ }\r
}\r
break;\r
\r
{\r
ib_api_status_t status;\r
/* Deregister the pool_key. */\r
- ref_al_obj( &p_qp_alias->pool_key->obj );\r
status = dereg_mad_pool( p_qp_alias->pool_key, AL_KEY_ALIAS );\r
if( status != IB_SUCCESS )\r
{\r
- AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("dereg_mad_pool returned %s.\n",\r
+ AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,\r
+ ("dereg_mad_pool returned %s.\n",\r
ib_get_err_str(status)) );\r
+ /* Release the reference taken when we created the pool key. */\r
deref_al_obj( &p_qp_alias->pool_key->obj );\r
}\r
p_qp_alias->pool_key = NULL;\r