From patchwork Tue Sep 7 14:53:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yevgeny Kliteynik X-Patchwork-Id: 161021 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o87Er9DG031460 for ; Tue, 7 Sep 2010 14:53:09 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757091Ab0IGOxH (ORCPT ); Tue, 7 Sep 2010 10:53:07 -0400 Received: from mail.mellanox.co.il ([194.90.237.43]:53562 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1757007Ab0IGOxG (ORCPT ); Tue, 7 Sep 2010 10:53:06 -0400 Received: from Internal Mail-Server by MTLPINE2 (envelope-from kliteyn@mellanox.co.il) with SMTP; 7 Sep 2010 17:52:25 +0300 Received: from [10.4.1.29] (10.4.1.29) by mtlmail01.mtl.com (10.0.8.12) with Microsoft SMTP Server id 8.2.254.0; Tue, 7 Sep 2010 17:53:03 +0300 Message-ID: <4C8651CF.2080807@mellanox.co.il> Date: Tue, 7 Sep 2010 17:53:03 +0300 From: Yevgeny Kliteynik Reply-To: kliteyn@dev.mellanox.co.il User-Agent: Thunderbird 1.5.0.5 (X11/20060719) MIME-Version: 1.0 To: Sasha Khapyorsky , Linux RDMA Subject: [PATCH] opensm/osm_trap_rcv.c: fix possible core dump Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 07 Sep 2010 14:53:10 +0000 (UTC) diff --git a/opensm/opensm/osm_trap_rcv.c b/opensm/opensm/osm_trap_rcv.c index 500632c..9f39644 100644 --- a/opensm/opensm/osm_trap_rcv.c +++ b/opensm/opensm/osm_trap_rcv.c @@ -510,10 +510,16 @@ static void trap_rcv_process_request(IN osm_sm_t * sm, "ERR 3812: No physical port found for " "trap 144: \"node description update\"\n"); goto check_sweep; - } else if (cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 145) - /* this assumes that trap 145 content is not broken? */ - p_physp->p_node->node_info.sys_guid = - p_ntci->data_details.ntc_145.new_sys_guid; + } else if (cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 145) { + if (p_physp) + /* this assumes that trap 145 content is not broken? */ + p_physp->p_node->node_info.sys_guid = + p_ntci->data_details.ntc_145.new_sys_guid; + else + OSM_LOG(sm->p_log, OSM_LOG_ERROR, + "ERR 3813: No physical port found for " + "trap 145: \"SystemImageGUID update\"\n"); + } check_sweep: /* do a sweep if we received a trap */