From 0df0088d69289f9ae59c885a6ae30c2f2244911f Mon Sep 17 00:00:00 2001 From: leonidk Date: Tue, 15 Aug 2006 15:59:28 +0000 Subject: [PATCH] [IBAL] bugfix: QP has to increment the reference on the pool key upon creation and not before destroying, when it can be already destroyed. Submitted by: Fabian Tillier [ftillier@silverstorm.com] git-svn-id: svn://openib.tc.cornell.edu/gen1@455 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/core/al/al_qp.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/trunk/core/al/al_qp.c b/trunk/core/al/al_qp.c index bcd2f5ae..9ff407ce 100644 --- a/trunk/core/al/al_qp.c +++ b/trunk/core/al/al_qp.c @@ -448,7 +448,14 @@ get_spl_qp( status = ib_reg_mad_pool( gh_mad_pool, h_pd, &((al_qp_alias_t*)h_qp)->pool_key ); if( status == IB_SUCCESS ) + { + /* + * Take a reference on the pool key since we don't have a + * mechanism for the pool key to clear the QP's pointer to it. + */ + ref_al_obj( &((al_qp_alias_t*)h_qp)->pool_key->obj ); *p_pool_key = ((al_qp_alias_t*)h_qp)->pool_key; + } } break; @@ -1063,12 +1070,13 @@ destroying_qp( { ib_api_status_t status; /* Deregister the pool_key. */ - ref_al_obj( &p_qp_alias->pool_key->obj ); status = dereg_mad_pool( p_qp_alias->pool_key, AL_KEY_ALIAS ); if( status != IB_SUCCESS ) { - AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("dereg_mad_pool returned %s.\n", + AL_PRINT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, + ("dereg_mad_pool returned %s.\n", ib_get_err_str(status)) ); + /* Release the reference taken when we created the pool key. */ deref_al_obj( &p_qp_alias->pool_key->obj ); } p_qp_alias->pool_key = NULL; -- 2.41.0