From patchwork Thu Jul 12 16:23:06 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 1189891 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C95A13FDAE for ; Thu, 12 Jul 2012 16:23:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757439Ab2GLQXQ (ORCPT ); Thu, 12 Jul 2012 12:23:16 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:38841 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755379Ab2GLQXP (ORCPT ); Thu, 12 Jul 2012 12:23:15 -0400 Received: by eaak11 with SMTP id k11so835784eaa.19 for ; Thu, 12 Jul 2012 09:23:11 -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=hoXF0nhrxXdHk8mEP7B0Vc8/0xl8enPaCdcz/ozUvWU=; b=VYjDAT2b9/7V25teY1MXolx0wQ+FRX7rIcfsXFuOIMNJOUoewHCzuGYaEji5GOoufF ckqQdjTtsD3fHx4A19ydtkHKh0z0lWkkCn+n3Mpxfrohj8T6JFikVeGUG0WQ9yU9yixk 7bl5C7H9qbTiA7Dm00whE+plqzoT22BPO0dHax+lBhFE4TPRWa+EsLVwnZ109e46BPES xJ81gYMOESNUMrnGpxLACuJJHGAZ3wGCGl+tWfx8zy5xhNaSlaExBlu/N8iXp89b35Gm b7rmCQ+0etz/LPozhm84Bm2owMMWEDzx4Gx6E8LkHjz7ONsPG/aX3Z852qd5hy91hFLH rwoQ== Received: by 10.14.94.136 with SMTP id n8mr745213eef.127.1342110191004; Thu, 12 Jul 2012 09:23:11 -0700 (PDT) Received: from [192.168.1.102] (c-71-192-10-85.hsd1.ma.comcast.net. [71.192.10.85]) by mx.google.com with ESMTPS id t3sm17019272eeb.15.2012.07.12.09.23.08 (version=SSLv3 cipher=OTHER); Thu, 12 Jul 2012 09:23:10 -0700 (PDT) Message-ID: <4FFEF9EA.4060006@dev.mellanox.co.il> Date: Thu, 12 Jul 2012 12:23:06 -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: Alex Netes CC: "linux-rdma (linux-rdma@vger.kernel.org)" Subject: [PATCH] opensm/osm_node_info_rcv.c: In ni_rcv_process_existing_ca_or_router, handle error X-Gm-Message-State: ALoCoQnCGx5fsPz+PzPsAroLtf1T6O8GErSLvJuL4pVD9yD5ucOld3y4VhkAZhed8TPYk0IdAESm Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Add handling for case where osm_node_get_physp_ptr returns NULL pointer Signed-off-by: Hal Rosenstock --- -- 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_node_info_rcv.c b/opensm/osm_node_info_rcv.c index 58c92b9..293f0c8 100644 --- a/opensm/osm_node_info_rcv.c +++ b/opensm/osm_node_info_rcv.c @@ -479,6 +479,16 @@ alias_done: } else { osm_physp_t *p_physp = osm_node_get_physp_ptr(p_node, port_num); + + if (p_physp == NULL) { + OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 0D1C: " + "No physical port found for node GUID 0x%" + PRIx64 " port %u. Might be duplicate port GUID\n", + cl_ntoh64(p_node->node_info.node_guid), + port_num); + goto Exit; + } + /* Update the DR Path to the port, in case the old one is no longer available.