opensm: fixed sizeof of pointer allocation in osm_ucast_lash()
PATCH 1/1 opensm: fixed sizeof of pointer allocation in osm_ucast_lash()
This fix is a cosmetic one, but this is the corect way to define sizeof in malloc.
--- opensm/osm_ucast_lash.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
opensm/osm_ucast_lash.c +2 -2
@@ -710,13 +710,13 @@ static int init_lash_structures(lash_t * p_lash)/* initialise cdg_vertex_matrix[num_switches][num_switches][num_switches] */ p_lash->cdg_vertex_matrix = - (cdg_vertex_t ****)malloc (vl_min *sizeof (cdg_vertex_t ****)); + (cdg_vertex_t ****)malloc (vl_min *sizeof (cdg_vertex_t ***));if (p_lash->cdg_vertex_matrix ==NULL ) goto Exit_Mem_Error;for (i =0 ; i < vl_min; i++) { p_lash->cdg_vertex_matrix[i] = (cdg_vertex_t ***)malloc (num_switches * -sizeof (cdg_vertex_t ***)); +sizeof (cdg_vertex_t **));if (p_lash->cdg_vertex_matrix[i] ==NULL ) goto Exit_Mem_Error;
Signature · 6 lines
1.7.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html