From patchwork Tue Jun 11 18:13:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2705401 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 BD27A9F765 for ; Tue, 11 Jun 2013 18:13:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B171203DA for ; Tue, 11 Jun 2013 18:13:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7427020357 for ; Tue, 11 Jun 2013 18:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755789Ab3FKSNv (ORCPT ); Tue, 11 Jun 2013 14:13:51 -0400 Received: from mail-ea0-f182.google.com ([209.85.215.182]:35516 "EHLO mail-ea0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755700Ab3FKSNv (ORCPT ); Tue, 11 Jun 2013 14:13:51 -0400 Received: by mail-ea0-f182.google.com with SMTP id d10so2598577eaj.13 for ; Tue, 11 Jun 2013 11:13:50 -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=IUZq4h4wKlwBb+GYoFC7k/BFIN5LOkY0VXPOu58q4P4=; b=dD6uvVqtve10oDozd9kS8GLQYfqjeXyQMtfpfgQxWpWuSag+GtUXqYkpneDuQnJvVC VD5poKdLXLaCL6iHJPlPtEi0sGXnpbhsDrCXxX4NZ0txj9QRM4UTwSe0HLqfxZtRFkAN iF7UtKUK4W5VLQJXfp9WpYunxD5SP7U7JYJrwxzkKOm1Px1VXYhwiNdOWFsl3yen6Eyk 5YSwaNLqJkyGPcEMzVw0uQCITgyC5L/4wOI0NZl3Z1pntOLx6d0pUPhsJmo1JoAzyS/u Ayz8ORAziIwYR/P0pnvXhD4qzY3+dc+UKsS/7I0UW6YD4RvfkX4cPezNg2PcXsz2qY8x l00w== X-Received: by 10.14.203.194 with SMTP id f42mr17894499eeo.53.1370974430134; Tue, 11 Jun 2013 11:13:50 -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 s8sm32002037eeo.4.2013.06.11.11.13.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Jun 2013 11:13:49 -0700 (PDT) Message-ID: <51B768DC.8060003@dev.mellanox.co.il> Date: Tue, 11 Jun 2013 14:13:48 -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: Dan Ben-Yosef Subject: [PATCH 4/6] osm_ucast_ftree.c: fix dereferencing null variable X-Gm-Message-State: ALoCoQkUvWdfwCxPzmipO2cEZj40DfyLjlf/5QWiG4GFkhvsFspIOLJd/BrKls+9WqappQXP6qOs Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-7.1 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 35f4419e6f2451f2124e826e8e93b02c733d068c Mon Sep 17 00:00:00 2001 From: Dan Ben Yosef Date: Sun, 2 Dec 2012 16:07:49 +0200 Subject: [PATCH 4/6] osm_ucast_ftree.c: fix dereferencing null variable Dereferencing null variable "p_port". Signed-off-by: Dan Ben Yosef --- opensm/osm_ucast_ftree.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/opensm/osm_ucast_ftree.c b/opensm/osm_ucast_ftree.c index a293803..decfc82 100644 --- a/opensm/osm_ucast_ftree.c +++ b/opensm/osm_ucast_ftree.c @@ -2591,6 +2591,8 @@ fabric_route_downgoing_by_going_up(IN ftree_fabric_t * p_ftree, trying to balance these routes - always pick port 0. */ p_min_port = NULL; ports_num = (uint16_t) cl_ptr_vector_get_size(&p_group->ports); + if(ports_num == 0) + continue; for (j = 0; j < ports_num; j++) { cl_ptr_vector_at(&p_group->ports, j, (void *)&p_port); if (!p_min_port) {