From patchwork Tue Nov 12 21:27:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 3175961 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 DD6759F39E for ; Tue, 12 Nov 2013 21:27:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 063CC205BA for ; Tue, 12 Nov 2013 21:27:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2267A205BD for ; Tue, 12 Nov 2013 21:27:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755901Ab3KLV1q (ORCPT ); Tue, 12 Nov 2013 16:27:46 -0500 Received: from mail-bk0-f47.google.com ([209.85.214.47]:35496 "EHLO mail-bk0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756786Ab3KLV1p (ORCPT ); Tue, 12 Nov 2013 16:27:45 -0500 Received: by mail-bk0-f47.google.com with SMTP id v11so2068807bkz.6 for ; Tue, 12 Nov 2013 13:27:44 -0800 (PST) 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=RCMzEplVKb+gqIg7ZeQevPxqP2YN6mkipE5/kCEC3dU=; b=It7TUK8BjX3ZKyr7NjxrZU5PBiRgGGVrsm4Y+ODBOz+lRrb+L0U4wr6iZuafyuFUyY PJNRIG8Wdty0vvgBn6JmpnkynBitmTWfj39CmnBLz/vp8GmPitlAebo7bhxLcVozQpmE m+xq80oAL4pblTCDAS0d45SvK9JdhtbODnm23sXk9QrX+UD19YEonDvqEMvbCMoqNTVM 5Ii9hV4Fg1As/lCCZmOMzFmCzM7uwjb2Y4VRSpOVqqhTRDL8mpJjh0Ira2sykdXWwAKW n45+Pft/8rhPqY+494JCGnZiWfonlxDL8yZDlDvkc9LWn9YDs35vNBHfC0vbiYO4o7fC +Sfw== X-Gm-Message-State: ALoCoQnploLvolJIMR3CDpx5FWRgC5zUc6dvYAtE2PJPFTcmR+/9ThHGeMDwyd47iqKV6YxZaT5u X-Received: by 10.204.163.138 with SMTP id a10mr13940697bky.9.1384291664270; Tue, 12 Nov 2013 13:27:44 -0800 (PST) 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 t2sm19885079bkh.3.2013.11.12.13.27.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 12 Nov 2013 13:27:43 -0800 (PST) Message-ID: <52829D4E.9070802@dev.mellanox.co.il> Date: Tue, 12 Nov 2013 16:27:42 -0500 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_link_mgr.c: Fix uninitialized value (physp0) 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=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 physp0 might be uninitialized Signed-off-by: Alex Netes --- -- 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_link_mgr.c b/opensm/osm_link_mgr.c index 44bfbe6..6bcfbf6 100644 --- a/opensm/osm_link_mgr.c +++ b/opensm/osm_link_mgr.c @@ -135,6 +135,9 @@ static int link_mgr_set_physp_pi(osm_sm_t * sm, IN osm_physp_t * p_physp, send_set = TRUE; } + if (osm_node_get_type(p_node) == IB_NODE_TYPE_SWITCH) + physp0 = osm_node_get_physp_ptr(p_node, 0); + if (port_num == 0) { /* CAs don't have a port 0, and for switch port 0, @@ -149,8 +152,6 @@ static int link_mgr_set_physp_pi(osm_sm_t * sm, IN osm_physp_t * p_physp, goto Exit; } - physp0 = osm_node_get_physp_ptr(p_physp->p_node, 0); - if (ib_switch_info_is_enhanced_port0(&p_node->sw->switch_info) == FALSE) { @@ -193,7 +194,7 @@ static int link_mgr_set_physp_pi(osm_sm_t * sm, IN osm_physp_t * p_physp, ib_port_info_set_port_state(p_pi, port_state); /* Determine ports' M_Key */ - if (osm_node_get_type(p_physp->p_node) == IB_NODE_TYPE_SWITCH && + if (osm_node_get_type(p_node) == IB_NODE_TYPE_SWITCH && osm_physp_get_port_num(p_physp) != 0) m_key = ib_port_info_get_m_key(&physp0->port_info); else