From patchwork Mon Dec 30 12:24:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 3419131 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 C67829F37A for ; Mon, 30 Dec 2013 12:25:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AC4F6200E5 for ; Mon, 30 Dec 2013 12:25:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0C3F2200EC for ; Mon, 30 Dec 2013 12:25:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755705Ab3L3MZA (ORCPT ); Mon, 30 Dec 2013 07:25:00 -0500 Received: from mail-ea0-f181.google.com ([209.85.215.181]:41104 "EHLO mail-ea0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755679Ab3L3MZA (ORCPT ); Mon, 30 Dec 2013 07:25:00 -0500 Received: by mail-ea0-f181.google.com with SMTP id m10so5010835eaj.26 for ; Mon, 30 Dec 2013 04:24:59 -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=duxsRykKweuGBDZzMLgb1UsPwdam24UKnObC/oj56Bg=; b=i6TLXCxHWMhSJLXngf5Nx7bnP8YxWXGIFY3F13uIah+J/A9jBP1unmiJKm8uGOQCA5 KKxAQuLU5b6CFBN9mYSgx/ueJVEPWsrF4uPptLdO/n6bUHoHh1Ss0Tw+d2GwRc5ivnzm KjTLTlduqIjbAmIQWhsvOYKbbQIo6W8A2DFEzgecxGU0FImcIozY6lqOKhXBDgqyh0lg tTYTY9qCM2MQoMEi0LInHwmledi3xVPAq6CM5LGfkfeefLkB31XYuZX6fc9PUKTwWqu3 RQ0dBKuE8COMWMq6lFLc8AY71L4QMfDqy+57xkdWl6fa+ADcm0G+K7waY1EA0sJ9FNEH 2kkQ== X-Gm-Message-State: ALoCoQlpML/J3qOwA5WdnkU2h4FpF0Fqvnv1iV+SPYKiq9eSkajSZ9oulaIPSqib2JAVg05qb/Wf X-Received: by 10.14.251.68 with SMTP id a44mr1406205ees.64.1388406299120; Mon, 30 Dec 2013 04:24:59 -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 e43sm108258495eep.7.2013.12.30.04.24.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Dec 2013 04:24:58 -0800 (PST) Message-ID: <52C16619.2000703@dev.mellanox.co.il> Date: Mon, 30 Dec 2013 07:24:57 -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_trap_rcv.c: fix race condition during sweep 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.0 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 If SM receives trap 128 from a physp it didn't discover yet, it will crash. Signed-off-by: Alex Netes Signed-off-by: Hal Rosenstock --- opensm/osm_trap_rcv.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/opensm/osm_trap_rcv.c b/opensm/osm_trap_rcv.c index 72df5db..d5f646f 100644 --- a/opensm/osm_trap_rcv.c +++ b/opensm/osm_trap_rcv.c @@ -568,7 +568,8 @@ check_sweep: if (osm_log_is_active_v2(sm->p_log, OSM_LOG_INFO, FILE_ID)) { if (ib_notice_is_generic(p_ntci) && cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == SM_LINK_STATE_CHANGED_TRAP) { - p_path = osm_physp_get_dr_path_ptr(p_physp); + p_path = (p_physp) ? + osm_physp_get_dr_path_ptr(p_physp) : NULL; if (p_path) { n = sprintf(buf, "SM class trap %u: ", cl_ntoh16(p_ntci->g_or_v.generic.trap_num));