From patchwork Tue Jun 11 18:13:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2705391 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 86FA1C1459 for ; Tue, 11 Jun 2013 18:13:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6B6ED203AF for ; Tue, 11 Jun 2013 18:13:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 170E520357 for ; Tue, 11 Jun 2013 18:13:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755782Ab3FKSNr (ORCPT ); Tue, 11 Jun 2013 14:13:47 -0400 Received: from mail-ee0-f43.google.com ([74.125.83.43]:36352 "EHLO mail-ee0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755665Ab3FKSNq (ORCPT ); Tue, 11 Jun 2013 14:13:46 -0400 Received: by mail-ee0-f43.google.com with SMTP id l10so3207451eei.16 for ; Tue, 11 Jun 2013 11:13:45 -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=JOb4VRgK3oLL7TbT3ivusRQ3UkrsXazu+Dpthzcgbio=; b=WH5Xs87kjfKxu2mm+2lD9SEDfJeQrehHhoKj+XTtGSFQK4oqN+opi228fIFodL6RhW ltg9tE+OuPBk9J9mvfBm+S+l7z6WZ4DY90rcy6O6rbiipO6YMBR/1as1LIAKf//V7ota 0A2qSl0Nt3/EYM5RoPWHqp61oTqL5SErI0gaZGAYC7b11KmkBXOCeh+xkV4Uy907/KCw KPut6al2zsgaervv5hXPDUQFIIUiN9HwN4XvG8esAbDnR8RLYncZRtMcdPiRbpVTWe0M pr5p+Z2rj7gwVaptBF1y6U84L6cnljNb+8EPCZnbdFwQbZDPSW7dq8bEpPR4ssBR3duj /JFQ== X-Received: by 10.14.223.134 with SMTP id v6mr17843908eep.4.1370974425610; Tue, 11 Jun 2013 11:13:45 -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 a5sm31987014ees.6.2013.06.11.11.13.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 11 Jun 2013 11:13:45 -0700 (PDT) Message-ID: <51B768D7.1000807@dev.mellanox.co.il> Date: Tue, 11 Jun 2013 14:13:43 -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 3/6] osm_ucast_ftree.c : fix dereferencing null variable X-Gm-Message-State: ALoCoQk8oLggxUqggwxd4Byi+rCF/LSYhnIengH9grbwtClayk+1m/lVmstQrT+7Kxb1d0u4QGwf 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=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 4d36d6d133c09e45fe394b3519ac9cae5ebbe1c5 Mon Sep 17 00:00:00 2001 From: Dan Ben Yosef Date: Sun, 2 Dec 2012 13:48:47 +0200 Subject: [PATCH 3/6] osm_ucast_ftree.c : fix dereferencing null variable Dereferencing null variable "p_min_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 dfcd418..a293803 100644 --- a/opensm/osm_ucast_ftree.c +++ b/opensm/osm_ucast_ftree.c @@ -2213,6 +2213,8 @@ fabric_route_upgoing_by_going_down(IN ftree_fabric_t * p_ftree, /* find the least loaded port of the group (in indexing order) */ 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);