diff mbox

opensm: Fixed pointer validity check in report_torus_changes()

Message ID 20110307095930.GH5577@calypso.voltaire.com (mailing list archive)
State Changes Requested
Delegated to: Alex Netes
Headers show

Commit Message

Alex Netes March 7, 2011, 9:59 a.m. UTC
None
diff mbox

Patch

diff --git a/opensm/osm_torus.c b/opensm/osm_torus.c
index add3cf9..7a2c252 100644
--- a/opensm/osm_torus.c
+++ b/opensm/osm_torus.c
@@ -7423,13 +7423,17 @@  void report_torus_changes(struct torus *nt, struct torus *ot)
 {
 	unsigned cnt = 0;
 	unsigned i, j, k;
-	unsigned x_sz = nt->x_sz;
-	unsigned y_sz = nt->y_sz;
-	unsigned z_sz = nt->z_sz;
+	unsigned x_sz;
+	unsigned y_sz;
+	unsigned z_sz;
 
 	if (!(nt && ot))
 		return;
 
+	x_sz = nt->x_sz;
+	y_sz = nt->y_sz;
+	z_sz = nt->z_sz;
+
 	if (x_sz != ot->x_sz) {
 		cnt++;
 		OSM_LOG(&nt->osm->log, OSM_LOG_INFO,