[ofa-general] [PATCH][MINOR] opensm/osm_sa_mcmember_record.c: Minor logic change in __get_new_mlid

Hal Rosenstock hrosenstock at xsigo.com
Wed Jun 4 04:37:00 PDT 2008


opensm/osm_sa_mcmember_record.c: Minor logic change in __get_new_mlid

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

diff --git a/opensm/opensm/osm_sa_mcmember_record.c b/opensm/opensm/osm_sa_mcmember_record.c
index c982f40..3cfd5f7 100644
--- a/opensm/opensm/osm_sa_mcmember_record.c
+++ b/opensm/opensm/osm_sa_mcmember_record.c
@@ -181,10 +181,9 @@ __get_new_mlid(IN osm_sa_t * sa, IN ib_net16_t requested_mlid)
 
 	/* track all used mlids in the array (by mlid index) */
 	used_mlids_array = (uint8_t *) malloc(sizeof(uint8_t) * max_num_mlids);
-	if (used_mlids_array)
-		memset(used_mlids_array, 0, sizeof(uint8_t) * max_num_mlids);
 	if (!used_mlids_array)
 		return 0;
+	memset(used_mlids_array, 0, sizeof(uint8_t) * max_num_mlids);
 
 	/* scan all available multicast groups in the DB and fill in the table */
 	while (p_mgrp != (osm_mgrp_t *) cl_qmap_end(&p_subn->mgrp_mlid_tbl)) {





More information about the general mailing list