From patchwork Tue Jul 23 15:17:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2832021 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B0E4EC0319 for ; Tue, 23 Jul 2013 15:17:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 950DF201C8 for ; Tue, 23 Jul 2013 15:17:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C6FD201C6 for ; Tue, 23 Jul 2013 15:17:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757611Ab3GWPRK (ORCPT ); Tue, 23 Jul 2013 11:17:10 -0400 Received: from mail-ea0-f171.google.com ([209.85.215.171]:47847 "EHLO mail-ea0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757514Ab3GWPRJ (ORCPT ); Tue, 23 Jul 2013 11:17:09 -0400 Received: by mail-ea0-f171.google.com with SMTP id m14so4575344eaj.2 for ; Tue, 23 Jul 2013 08:17:07 -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=lWxUv0g9LRM7RcXalOnwqFQdh8zGPtPxvn+zXarWGrw=; b=OyqnCekjvfTQH71BMcirarEEF0rp+dmjwRIrWNJbM0w+PmWn5wKGzhmceMjdF6Anz1 OGqpsaq5oc7FTq2OP6FbjNSYDSQtaVKJSa6fnmH2wqGVvIck160qtUQhmBXh+/RLIPdj gF94+qGw+xEBJhMe1EG6Kt+6vj874UnrGY+ZOs5lqAaECIw17jylH0uet3Kd4El48cCx gVM4bxwILuRh5cOpyZffASmg6xzZqdpIjjAU7tioj00z15SO/vNLXufgaLwhqIe3Rave X6CPtzOGhdCyNnYYuD4vJNN57ZBcHqS+CZKkc+skMdgxlq+Ce2VkpT2FIwMDZb23zHKx knYw== X-Received: by 10.14.69.206 with SMTP id n54mr32626665eed.154.1374592627769; Tue, 23 Jul 2013 08:17:07 -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 r54sm59376143eev.8.2013.07.23.08.17.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 23 Jul 2013 08:17:06 -0700 (PDT) Message-ID: <51EE9E6F.8000402@dev.mellanox.co.il> Date: Tue, 23 Jul 2013 11:17:03 -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] opensm/osm_db_pack.c: Removed uneeded asserts X-Gm-Message-State: ALoCoQnsFmU2vgW8n38hLQloH8l/MPaKW6uTNMHhmqo0gtIEs5KlWYeZE+1tyLt9OqQh8LrUZs1k 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, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Out of range lids isn't a fatal event and SM code just ignores these lids. Signed-off-by: Alex Netes --- opensm/osm_db_pack.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/opensm/osm_db_pack.c b/opensm/osm_db_pack.c index 708a875..8cddd06 100644 --- a/opensm/osm_db_pack.c +++ b/opensm/osm_db_pack.c @@ -73,14 +73,18 @@ static inline int unpack_lids(IN char *p_lid_str, OUT uint16_t * p_min_lid, if (!p_num) return 1; tmp = strtoul(p_num, NULL, 0); - CL_ASSERT(tmp < 0x10000); + if (tmp >= 0xC000) + return 1; + *p_min_lid = (uint16_t) tmp; p_num = strtok_r(NULL, " \t", &p_next); if (!p_num) return 1; tmp = strtoul(p_num, NULL, 0); - CL_ASSERT(tmp < 0x10000); + if (tmp >= 0xC000) + return 1; + *p_max_lid = (uint16_t) tmp; return 0;