From patchwork Mon Jun 24 13:58:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2771681 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 84BAB9F245 for ; Mon, 24 Jun 2013 13:58:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F6A42025A for ; Mon, 24 Jun 2013 13:58:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DFE2220250 for ; Mon, 24 Jun 2013 13:58:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751190Ab3FXN6h (ORCPT ); Mon, 24 Jun 2013 09:58:37 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:34497 "EHLO mail-bk0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750875Ab3FXN6h (ORCPT ); Mon, 24 Jun 2013 09:58:37 -0400 Received: by mail-bk0-f45.google.com with SMTP id je9so4151635bkc.4 for ; Mon, 24 Jun 2013 06:58:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=MEd1TE3LMd/RE7r4JOGZsWUxRuuU4CdqxaAmnVxKRSg=; b=KS7jCg9obQuKWpz43Fz9Yo33pskrtaxrIWxpeDDuhIoW03o6SOf+W+dxLy1s6oK1eR lq7YtIM9gEMtpzHT8FIhD9HHOOQUs/PI4plkgG0oYds00upONDTc5cIkxdY+7PFXDpT9 eoN3DzvScQZLBOza4pP55FXyGomqR0d4iVe2Z6AA1CA+xlBdioY8MIHapIrPLpc3B7Z3 qz/OEZCOG/2jDei6Ut4QOxrHRfLaMGMWXC+/j07VFL96G1Wev+2gVgArQuqbEIiVCdby GCsbtyoNtdZL5qokmtBgKX37y2JSfU4WCcoFC7w58B5TjFzE3F49jhOWkvGVNfjzbo12 bSYQ== X-Received: by 10.205.23.133 with SMTP id ra5mr3612468bkb.105.1372082315485; Mon, 24 Jun 2013 06:58:35 -0700 (PDT) Received: from [192.168.1.102] (c-71-234-225-85.hsd1.ct.comcast.net. [71.234.225.85]) by mx.google.com with ESMTPSA id de17sm1788442bkb.5.2013.06.24.06.58.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 24 Jun 2013 06:58:34 -0700 (PDT) Message-ID: <51C85087.6020307@dev.mellanox.co.il> Date: Mon, 24 Jun 2013 09:58:31 -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: Alex Netes Subject: [PATCH opensm] osm_trap_rcv.c: fix crash in babbling port feature X-Gm-Message-State: ALoCoQmx+l1M8zT2dhlQRP6EVyhC4z2sR9c3IE5ZZ7u0OU0JqrC4OumUTjXvNfkhMSTcEE41pp5p Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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: Alex Netes Port number should be less than number of ports (and never equal to). Found-by: Moawya Wahdan Signed-off-by: Alex Netes Signed-off-by: Hal Rosenstock --- opensm/osm_trap_rcv.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/opensm/osm_trap_rcv.c b/opensm/osm_trap_rcv.c index 5682679..df222de 100644 --- a/opensm/osm_trap_rcv.c +++ b/opensm/osm_trap_rcv.c @@ -91,7 +91,7 @@ static osm_physp_t *get_physp_by_lid_and_num(IN osm_sm_t * sm, if (!p_port) return NULL; - if (osm_node_get_num_physp(p_port->p_node) < num) + if (osm_node_get_num_physp(p_port->p_node) <= num) return NULL; return osm_node_get_physp_ptr(p_port->p_node, num);