From patchwork Mon Mar 7 11:24:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 615731 X-Patchwork-Delegate: alexne@voltaire.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p27Ef6h2026795 for ; Mon, 7 Mar 2011 14:41:06 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753333Ab1CGOlD (ORCPT ); Mon, 7 Mar 2011 09:41:03 -0500 Received: from mail.mellanox.co.il ([194.90.237.43]:52319 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752994Ab1CGOlA (ORCPT ); Mon, 7 Mar 2011 09:41:00 -0500 Received: from Internal Mail-Server by MTLPINE2 (envelope-from alexne@mellanox.com) with SMTP; 7 Mar 2011 13:24:29 +0200 Received: from MTRCASDAG01.mtl.com (172.25.0.174) by MTLCAS02.mtl.com (10.0.8.72) with Microsoft SMTP Server (TLS) id 14.1.270.1; Mon, 7 Mar 2011 13:24:29 +0200 Received: from localhost (172.25.6.157) by MTRCASDAG01.mtl.com (172.25.0.174) with Microsoft SMTP Server (TLS) id 14.1.270.1; Mon, 7 Mar 2011 13:24:29 +0200 Date: Mon, 7 Mar 2011 13:24:23 +0200 From: Alex Netes To: Subject: [PATCH] opensm: fixed sizeof of pointer allocation in osm_ucast_lash() Message-ID: <20110307112423.GL5577@calypso.voltaire.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Originating-IP: [172.25.6.157] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 07 Mar 2011 14:41:06 +0000 (UTC) diff --git a/opensm/osm_ucast_lash.c b/opensm/osm_ucast_lash.c index 0bd1827..739eedd 100644 --- a/opensm/osm_ucast_lash.c +++ b/opensm/osm_ucast_lash.c @@ -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;