From patchwork Fri May 29 12:47:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 6507451 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1B9799F3D1 for ; Fri, 29 May 2015 12:47:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39CE92061B for ; Fri, 29 May 2015 12:47:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F1F0A20621 for ; Fri, 29 May 2015 12:47:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756137AbbE2Mrb (ORCPT ); Fri, 29 May 2015 08:47:31 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:38683 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756134AbbE2Mr0 (ORCPT ); Fri, 29 May 2015 08:47:26 -0400 Received: by wizo1 with SMTP id o1so22359143wiz.1 for ; Fri, 29 May 2015 05:47:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:content-type:content-transfer-encoding; bh=9diAQR3nDqZMLyjbIK+1nW0xS+Nm5IZrmOkOehlRP4E=; b=drDo0R8w62qwuyPAug3Iwwi+floiCwloWlGa+M+fcTdT0UMyarOlb/7y56Zht8pJk6 OJtXOKWDOfHWaoEc2vfUS7PHjKN6ZlfLEQkIRthlgRC+Zm9h5P+znjZtg8XIp4NqKzvq KaHiF23l5XKfbFvdpiY9OxscJ98tUrX0TQ0vhf3EdG76Ztfsv7LjWAdu56/wJxWfE/nP MWfcQsB4D4C07SMxGoPzzuJttwkGvlmua0LDY1t1/HSmsxaXqNVscEgH+TJ4/uySdKlH TrXtC4g0vhSN2uHfodP0DvQaqMDpVBDlqyGoQhEgjKP6HLf9y7sEsDRAoXitw7MRF47C ZGsA== X-Gm-Message-State: ALoCoQmHIAFwxIzEeFfPp3o9ukqWBOeR/mNEeUUS7Sx2DktIe8y2/VegJBv/uDO+oTQKWhMKT6hZ X-Received: by 10.194.189.80 with SMTP id gg16mr15246100wjc.9.1432903644639; Fri, 29 May 2015 05:47:24 -0700 (PDT) Received: from [192.168.1.102] (c-98-229-118-119.hsd1.ma.comcast.net. [98.229.118.119]) by mx.google.com with ESMTPSA id gi14sm8201073wjc.42.2015.05.29.05.47.22 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 May 2015 05:47:23 -0700 (PDT) Message-ID: <55685FF8.8000306@dev.mellanox.co.il> Date: Fri, 29 May 2015 08:47:52 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "linux-rdma (linux-rdma@vger.kernel.org)" CC: Ilya Nelkenbaum , "rafiw@mellanox.com" Subject: [PATCH opensm] osm_mcast_tbl.c: Wrong assert placement in osm_mcast_tbl_get_block Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ilya Nelkenbaum Date: Mon, 28 Jan 2013 13:53:38 +0200 Signed-off-by: Ilya Nelkenbaum Signed-off-by: Hal Rosenstock --- -- 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 --git a/opensm/osm_mcast_tbl.c b/opensm/osm_mcast_tbl.c index c4a64e2..617fd50 100644 --- a/opensm/osm_mcast_tbl.c +++ b/opensm/osm_mcast_tbl.c @@ -242,7 +242,6 @@ boolean_t osm_mcast_tbl_get_block(IN osm_mcast_tbl_t * p_tbl, CL_ASSERT(p_tbl); CL_ASSERT(p_block); - CL_ASSERT(block_num * IB_MCAST_BLOCK_SIZE <= p_tbl->mft_depth); if (block_num > p_tbl->max_block_in_use) return FALSE; @@ -255,6 +254,8 @@ boolean_t osm_mcast_tbl_get_block(IN osm_mcast_tbl_t * p_tbl, return TRUE; } + CL_ASSERT(block_num * IB_MCAST_BLOCK_SIZE <= p_tbl->mft_depth); + mlid_start_ho = (uint16_t) (block_num * IB_MCAST_BLOCK_SIZE); for (i = 0; i < IB_MCAST_BLOCK_SIZE; i++)