[ofa-general] ***SPAM*** [PATCH] opensm: Return error status when cl_disp_register fails

Hal Rosenstock hnrose at comcast.net
Mon Mar 2 04:03:06 PST 2009


Also, in perfmgr, return error on db_construct failure

Signed-off-by: Hal Rosenstock <hal.rosenstock at gmail.com>

---
diff --git a/opensm/opensm/osm_perfmgr.c b/opensm/opensm/osm_perfmgr.c
index 58b5dc2..43278ae 100644
--- a/opensm/opensm/osm_perfmgr.c
+++ b/opensm/opensm/osm_perfmgr.c
@@ -1215,7 +1215,7 @@ ib_api_status_t
 osm_perfmgr_init(osm_perfmgr_t * const pm, osm_opensm_t *osm,
 		 const osm_subn_opt_t * const p_opt)
 {
-	ib_api_status_t status = IB_SUCCESS;
+	ib_api_status_t status;
 
 	OSM_LOG_ENTER(&osm->log);
 
@@ -1242,6 +1242,7 @@ osm_perfmgr_init(osm_perfmgr_t * const pm, osm_opensm_t *osm,
 	if (status != IB_SUCCESS)
 		goto Exit;
 
+	status = IB_INSUFFICIENT_RESOURCES;
 	pm->db = perfmgr_db_construct(pm);
 	if (!pm->db) {
 		pm->state = PERFMGR_STATE_NO_DB;
@@ -1259,6 +1260,7 @@ osm_perfmgr_init(osm_perfmgr_t * const pm, osm_opensm_t *osm,
 
 	cl_timer_start(&pm->sweep_timer, pm->sweep_time_s * 1000);
 
+	status = IB_SUCCESS;
 Exit:
 	OSM_LOG_EXIT(pm->log);
 	return (status);
diff --git a/opensm/opensm/osm_sa.c b/opensm/opensm/osm_sa.c
index 416d44a..50c4d45 100644
--- a/opensm/opensm/osm_sa.c
+++ b/opensm/opensm/osm_sa.c
@@ -163,7 +163,7 @@ osm_sa_init(IN osm_sm_t * const p_sm,
 	    IN osm_stats_t * const p_stats,
 	    IN cl_dispatcher_t * const p_disp, IN cl_plock_t * const p_lock)
 {
-	ib_api_status_t status = IB_SUCCESS;
+	ib_api_status_t status;
 
 	OSM_LOG_ENTER(p_log);
 
@@ -189,6 +189,7 @@ osm_sa_init(IN osm_sm_t * const p_sm,
 	if (status != IB_SUCCESS)
 		goto Exit;
 
+	status = IB_INSUFFICIENT_RESOURCES;
 	p_sa->cpi_disp_h = cl_disp_register(p_disp, OSM_MSG_MAD_CLASS_PORT_INFO,
 					    osm_cpi_rcv_process, p_sa);
 	if (p_sa->cpi_disp_h == CL_DISP_INVALID_HANDLE)
@@ -287,6 +288,7 @@ osm_sa_init(IN osm_sm_t * const p_sm,
 	if (p_sa->mft_disp_h == CL_DISP_INVALID_HANDLE)
 		goto Exit;
 
+	status = IB_SUCCESS;
 Exit:
 	OSM_LOG_EXIT(p_log);
 	return (status);
diff --git a/opensm/opensm/osm_sm.c b/opensm/opensm/osm_sm.c
index d1d8863..60dcdbb 100644
--- a/opensm/opensm/osm_sm.c
+++ b/opensm/opensm/osm_sm.c
@@ -254,7 +254,7 @@ osm_sm_init(IN osm_sm_t * const p_sm,
 	    IN osm_stats_t * const p_stats,
 	    IN cl_dispatcher_t * const p_disp, IN cl_plock_t * const p_lock)
 {
-	ib_api_status_t status = IB_SUCCESS;
+	ib_api_status_t status;
 
 	OSM_LOG_ENTER(p_log);
 
@@ -319,6 +319,7 @@ osm_sm_init(IN osm_sm_t * const p_sm,
 	if (status != IB_SUCCESS)
 		goto Exit;
 
+	status = IB_INSUFFICIENT_RESOURCES;
 	p_sm->sweep_fail_disp_h = cl_disp_register(p_disp,
 						   OSM_MSG_LIGHT_SWEEP_FAIL,
 						   sweep_fail_process, p_sm);



More information about the general mailing list