[ofa-general] [PATCH] libibmad: initialize sm portid in ib_resolve_smlid()

Sasha Khapyorsky sashak at voltaire.com
Fri Dec 21 08:30:37 PST 2007


Initialize sm portid in ib_resolve_smlid() - likely it fixes crash when
in debug mode uninitialized direct path array printed.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---
 libibmad/src/resolve.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libibmad/src/resolve.c b/libibmad/src/resolve.c
index 05b443d..d8365b2 100644
--- a/libibmad/src/resolve.c
+++ b/libibmad/src/resolve.c
@@ -56,6 +56,8 @@ ib_resolve_smlid(ib_portid_t *sm_id, int timeout)
 	uint8_t portinfo[64];
 	int lid;
 
+	memset(sm_id, 0, sizeof(*sm_id));
+
 	if (!smp_query(portinfo, &self, IB_ATTR_PORT_INFO, 0, 0))
 		return -1;
 
-- 
1.5.3.4.206.g58ba4




More information about the general mailing list