diff mbox

ibutils/ibis: fix ibis_get_local_ports_info uninitialized variable

Message ID 532AA981.9080403@dev.mellanox.co.il (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Ilya Nelkenbaum March 20, 2014, 8:40 a.m. UTC
Initialize attr_array before calling osm_vendor_get_all_port_attr

Signed-off-by: Eitan Zahavi <eitan@mellanox.co.il>
Signed-off-by: Daniel Klein <danielk@mellanox.com>
---
 ibis/src/ibis.i          |    1 +
 ibis/src/ibis_wrap.c     |    1 +
 ibis/src/ibissh_wrap.cpp |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/ibis/src/ibis.i b/ibis/src/ibis.i
index 8fc4440..28a0912 100644
--- a/ibis/src/ibis.i
+++ b/ibis/src/ibis.i
@@ -385,6 +385,7 @@  ibisp_is_debug(void)
 	 static char res[128];
 	 Tcl_Obj *p_obj;
 
+    memset(attr_array, 0, MAX_LOCAL_IBPORTS*sizeof(ib_port_attr_t));
     if (!IbisObj.initialized)
     {
       Tcl_SetStringObj(
diff --git a/ibis/src/ibis_wrap.c b/ibis/src/ibis_wrap.c
index 5098c2a..ee97601 100644
--- a/ibis/src/ibis_wrap.c
+++ b/ibis/src/ibis_wrap.c
@@ -3209,6 +3209,7 @@  typedef struct {
 	 static char res[128];
 	 Tcl_Obj *p_obj;
 
+    memset(attr_array, 0, MAX_LOCAL_IBPORTS*sizeof(ib_port_attr_t));
     if (!IbisObj.initialized)
     {
       Tcl_SetStringObj(
diff --git a/ibis/src/ibissh_wrap.cpp b/ibis/src/ibissh_wrap.cpp
index f75cde6..917904f 100644
--- a/ibis/src/ibissh_wrap.cpp
+++ b/ibis/src/ibissh_wrap.cpp
@@ -3209,6 +3209,7 @@  typedef struct {
 	 static char res[128];
 	 Tcl_Obj *p_obj;
 
+    memset(attr_array, 0, MAX_LOCAL_IBPORTS*sizeof(ib_port_attr_t));
     if (!IbisObj.initialized)
     {
       Tcl_SetStringObj(