[ofa-general] [PATCH] opensm/osm_ucast_cache.c: fixing wrong memset size

Yevgeny Kliteynik kliteyn at dev.mellanox.co.il
Sun Nov 2 07:54:47 PST 2008


Fixing wrong memset size in osm_ucast_cache.c

Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
---
 opensm/opensm/osm_ucast_cache.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/opensm/opensm/osm_ucast_cache.c b/opensm/opensm/osm_ucast_cache.c
index cfbc49a..9db8d59 100644
--- a/opensm/opensm/osm_ucast_cache.c
+++ b/opensm/opensm/osm_ucast_cache.c
@@ -118,7 +118,8 @@ static cache_switch_t *__cache_sw_new(uint16_t lid_ho)
 		return NULL;
 	}

-	memset(p_cache_sw->ports, 0, sizeof(*p_cache_sw->ports));
+	memset(p_cache_sw->ports, 0,
+	       sizeof(cache_port_t) * (CACHE_SW_PORTS + 1));
 	p_cache_sw->num_ports = CACHE_SW_PORTS + 1;

 	/* port[0] fields represent this switch details - lid and type */
-- 
1.5.1.4




More information about the general mailing list