From bc095c4305dc732ddb784f27919b7778c213fd96 Mon Sep 17 00:00:00 2001 From: leonidk Date: Mon, 14 Apr 2008 09:25:34 +0000 Subject: [PATCH] [IBAL] added sanity checks git-svn-id: svn://openib.tc.cornell.edu/gen1@1059 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86 --- trunk/core/al/al_pd.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/trunk/core/al/al_pd.c b/trunk/core/al/al_pd.c index a9363ec9..09cf8e9a 100644 --- a/trunk/core/al/al_pd.c +++ b/trunk/core/al/al_pd.c @@ -333,24 +333,11 @@ ib_create_qp( AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PD_HANDLE\n") ); return IB_INVALID_PD_HANDLE; } - -#if 0 - /* seems like no need in these checks */ - if( !p_qp_create->rq_depth || !p_qp_create->sq_depth ) - { - AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_MAX_WRS (%d:%d)\n", - p_qp_create->rq_depth, p_qp_create->sq_depth ) ); - return IB_INVALID_MAX_WRS; - } - - if( !p_qp_create->rq_sge || !p_qp_create->sq_sge) + if( !p_qp_create || !ph_qp ) { - AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_MAX_SGE (%d:%d)\n", - p_qp_create->rq_sge, p_qp_create->sq_sge ) ); - return IB_INVALID_MAX_SGE; + AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR, ("IB_INVALID_PARAMETER\n") ); + return IB_INVALID_PARAMETER; } -#endif - if (h_pd->obj.p_ci_ca && h_pd->obj.p_ci_ca->p_pnp_attr) { if ((p_qp_create->rq_depth > h_pd->obj.p_ci_ca->p_pnp_attr->max_wrs) || -- 2.41.0