From patchwork Mon Nov 2 19:06:54 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 57115 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA2J76q0007549 for ; Mon, 2 Nov 2009 19:07:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752571AbZKBTHB (ORCPT ); Mon, 2 Nov 2009 14:07:01 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755710AbZKBTHA (ORCPT ); Mon, 2 Nov 2009 14:07:00 -0500 Received: from qmta08.westchester.pa.mail.comcast.net ([76.96.62.80]:56362 "EHLO QMTA08.westchester.pa.mail.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752571AbZKBTHA (ORCPT ); Mon, 2 Nov 2009 14:07:00 -0500 Received: from OMTA20.westchester.pa.mail.comcast.net ([76.96.62.71]) by QMTA08.westchester.pa.mail.comcast.net with comcast id 0CzB1d0051YDfWL58K5zMS; Mon, 02 Nov 2009 19:05:59 +0000 Received: from hal.comcast.net ([75.69.247.31]) by OMTA20.westchester.pa.mail.comcast.net with comcast id 0KCc1d00C0hNrtn3gKCc8N; Mon, 02 Nov 2009 19:12:36 +0000 Received: from hal.comcast.net (localhost.localdomain [127.0.0.1]) by hal.comcast.net (8.14.3/8.14.3) with ESMTP id nA2J7hWc018976; Mon, 2 Nov 2009 14:07:47 -0500 Received: (from hnrose@localhost) by hal.comcast.net (8.14.3/8.14.3/Submit) id nA2J6sZv018942; Mon, 2 Nov 2009 14:06:54 -0500 Date: Mon, 2 Nov 2009 14:06:54 -0500 From: Hal Rosenstock To: sashak@voltaire.com Cc: linux-rdma@vger.kernel.org Subject: [PATCH] opensm/osm_mcast_tbl: Fix size of port mask table array Message-ID: <20091102190654.GA18937@comcast.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org diff --git a/opensm/include/opensm/osm_mcast_tbl.h b/opensm/include/opensm/osm_mcast_tbl.h index 6d3f083..0745b5b 100644 --- a/opensm/include/opensm/osm_mcast_tbl.h +++ b/opensm/include/opensm/osm_mcast_tbl.h @@ -76,7 +76,7 @@ typedef struct osm_mcast_fwdbl { uint16_t num_entries; uint16_t max_mlid_ho; uint16_t mft_depth; - uint16_t(*p_mask_tbl)[][IB_MCAST_POSITION_MAX]; + uint16_t(*p_mask_tbl)[][IB_MCAST_POSITION_MAX + 1]; } osm_mcast_tbl_t; /* * FIELDS @@ -106,7 +106,7 @@ typedef struct osm_mcast_fwdbl { * * p_mask_tbl * Pointer to a two dimensional array of port_masks for this switch. -* The first dimension is MLID, the second dimension is mask position. +* The first dimension is MLID offset, second dimension is mask position. * This pointer is null for switches that do not support multicast. * * SEE ALSO diff --git a/opensm/opensm/osm_mcast_tbl.c b/opensm/opensm/osm_mcast_tbl.c index 818f2e0..c2c5395 100644 --- a/opensm/opensm/osm_mcast_tbl.c +++ b/opensm/opensm/osm_mcast_tbl.c @@ -119,7 +119,7 @@ void osm_mcast_tbl_set(IN osm_mcast_tbl_t * p_tbl, IN uint16_t mlid_ho, int osm_mcast_tbl_realloc(IN osm_mcast_tbl_t * p_tbl, IN uintn_t mlid_offset) { size_t mft_depth, size; - uint16_t (*p_mask_tbl)[][IB_MCAST_POSITION_MAX]; + uint16_t (*p_mask_tbl)[][IB_MCAST_POSITION_MAX + 1]; if (mlid_offset < p_tbl->mft_depth) goto done;