diff mbox

[2/2] infiniband-diags/libibnetdisc/chassis.c: In group_nodes, set fabric->chassis

Message ID 20100602130415.GB4715@comcast.net (mailing list archive)
State Not Applicable
Headers show

Commit Message

Hal Rosenstock June 2, 2010, 1:04 p.m. UTC
None
diff mbox

Patch

diff --git a/infiniband-diags/libibnetdisc/src/chassis.c b/infiniband-diags/libibnetdisc/src/chassis.c
index f5f683e..25d7473 100644
--- a/infiniband-diags/libibnetdisc/src/chassis.c
+++ b/infiniband-diags/libibnetdisc/src/chassis.c
@@ -2,6 +2,7 @@ 
  * Copyright (c) 2004-2009 Voltaire Inc.  All rights reserved.
  * Copyright (c) 2007 Xsigo Systems Inc.  All rights reserved.
  * Copyright (c) 2008 Lawrence Livermore National Lab.  All rights reserved.
+ * Copyright (c) 2010 HNR Consulting.  All rights reserved.
  *
  * This software is available to you under a choice of one of two
  * licenses.  You may choose to be licensed under the terms of the GNU
@@ -1074,6 +1075,8 @@  int group_nodes(ibnd_fabric_t * fabric)
 				chassis_scan.current_chassis->chassisguid =
 				    get_chassisguid(node);
 				chassis_scan.current_chassis->nodecount = 1;
+				if (!fabric->chassis)
+					fabric->chassis = chassis_scan.first_chassis;
 			}
 		}
 	}
@@ -1107,5 +1110,6 @@  cleanup:
 		free(ch);
 		ch = ch_next;
 	}
+	fabric->chassis = NULL;
 	return -1;
 }