uint16_t i;\r
\r
ci_ca_lock_attr( p_ci_ca );\r
+\r
+ // sanity check\r
+ if (port_num == 0 || port_num > p_ci_ca->p_user_attr->num_ports)\r
+ {\r
+ AL_PRINT(TRACE_LEVEL_WARNING ,AL_DBG_AV,\r
+ ("UAL_GET_GID_INDEX: invalid port number specified (%d)\n", port_num) );\r
+ status = IB_INVALID_PORT;\r
+ goto out;\r
+ }\r
+\r
p_port_attr = &p_ci_ca->p_user_attr->p_port_attr[port_num];\r
for( i = 0; i < p_port_attr->num_gids; i++ )\r
{\r
break;\r
}\r
}\r
+\r
+out:\r
ci_ca_unlock_attr( p_ci_ca );\r
\r
return status;\r
if (!context->db_list_mutex)\r
goto err_db_mutex;\r
\r
- context->ibv_ctx.mutex = CreateMutex(NULL, FALSE, NULL);\r
- if (!context->ibv_ctx.mutex)\r
- goto err_ctx_mutex;\r
-\r
if (cl_spinlock_init(&context->uar_lock))\r
goto err_uar_spinlock;\r
\r
err_bf_spinlock:\r
cl_spinlock_destroy(&context->uar_lock);\r
err_uar_spinlock:\r
- CloseHandle(context->ibv_ctx.mutex);\r
-err_ctx_mutex:\r
CloseHandle(context->db_list_mutex);\r
err_db_mutex:\r
#ifdef XRC_SUPPORT\r
\r
cl_spinlock_destroy(&context->bf_lock);\r
cl_spinlock_destroy(&context->uar_lock);\r
- CloseHandle(context->ibv_ctx.mutex);\r
CloseHandle(context->db_list_mutex);\r
#ifdef XRC_SUPPORT\r
CloseHandle(context->xrc_srq_table_mutex);\r