Also, in perfmgr, return error on db_construct failure

Signed-off-by: Hal Rosenstock <[email protected]>

---
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);
_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to