diff mbox

[opensm] Use after free in osm_prtn_delete

Message ID 52307039.8060209@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Hal Rosenstock
Headers show

Commit Message

Hal Rosenstock Sept. 11, 2013, 1:29 p.m. UTC
From: Vladimir Koushnir <vladimirk@mellanox.com>

Signed-off-by: Vladimir Koushnir <vladimirk@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
 opensm/osm_prtn.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/opensm/osm_prtn.c b/opensm/osm_prtn.c
index ca7703d..24a1fe3 100644
--- a/opensm/osm_prtn.c
+++ b/opensm/osm_prtn.c
@@ -105,13 +105,13 @@  void osm_prtn_delete(IN osm_subn_t * p_subn, IN OUT osm_prtn_t ** pp_prtn)
 			/* osm_mgrp_cleanup will not delete
 			 * "well_known" groups */
 			p->mgrps[i]->well_known = FALSE;
-			osm_mgrp_cleanup(p_subn, p->mgrps[i]);
 			OSM_LOG(&p_subn->p_osm->log, OSM_LOG_DEBUG,
 				"removing mgroup %s from partition (0x%x)\n",
 				inet_ntop(AF_INET6,
 					  p->mgrps[i]->mcmember_rec.mgid.raw,
 					  gid_str, sizeof gid_str),
 				cl_hton16(p->pkey));
+			osm_mgrp_cleanup(p_subn, p->mgrps[i]);
 		}
 
 		free(p->mgrps);