From patchwork Thu Jun 5 14:50:08 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 4306201 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 63CC79F1D6 for ; Thu, 5 Jun 2014 14:50:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 660A12017E for ; Thu, 5 Jun 2014 14:50:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65BB220142 for ; Thu, 5 Jun 2014 14:50:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751349AbaFEOuQ (ORCPT ); Thu, 5 Jun 2014 10:50:16 -0400 Received: from mail-we0-f182.google.com ([74.125.82.182]:62142 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751082AbaFEOuP (ORCPT ); Thu, 5 Jun 2014 10:50:15 -0400 Received: by mail-we0-f182.google.com with SMTP id t60so1279560wes.27 for ; Thu, 05 Jun 2014 07:50:14 -0700 (PDT) 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=1Q/sAnIwMtsekIhHNUVmPX//iIdV/LVXQKF3uTinlFU=; b=SdRmwqekNv30l+Suzxll5g+c4SOV/GapMQxLxS8rZl5Po0HN1pPWCmfzLUe5LDg7ks TLTwEp4pK+wga+pzd7nv3wcOkZCvFDI8kZg/cbO0CJeL3fLjSt/GjD7xlwIPgyW7yEh2 V+lJWc+SbCj4IRrUlaW7qEghzW0Mxv3hzWuoNLGxUaSQyXx9OicbID6qy6/8IYttMbUi R2z5oSnRKEalm6kZBkZzfdRh1Hrj/vtc+i59rHDsNh0U+cib2Cj6jyefDk25gvPgmRbq sltTjou4nUwl+4+JMrgno/DmwnhyeZdRRMzlYUVb000nRH/BKhufphRpWr7OG4yvR7Uv ngLw== X-Gm-Message-State: ALoCoQlk9whtcpVhCA2gVkIGVBx3X7iXbBWHRdovBZhE180ynP4PgkHzvcvGzx+guRtJOhtUNoOM X-Received: by 10.180.77.225 with SMTP id v1mr16382620wiw.5.1401979813704; Thu, 05 Jun 2014 07:50:13 -0700 (PDT) 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 u1sm15952265wia.16.2014.06.05.07.50.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 05 Jun 2014 07:50:12 -0700 (PDT) Message-ID: <539083A0.5040104@dev.mellanox.co.il> Date: Thu, 05 Jun 2014 10:50:08 -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: Vladimir Koushnir Subject: [PATCH opensm] osm_trap_rcv.c: Lock released without locking in some cases of trap processing 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.5 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 Signed-off-by: Vladimir Koushnir Signed-off-by: Hal Rosenstock --- opensm/osm_trap_rcv.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/opensm/osm_trap_rcv.c b/opensm/osm_trap_rcv.c index ce26efa..2aef40e 100644 --- a/opensm/osm_trap_rcv.c +++ b/opensm/osm_trap_rcv.c @@ -390,7 +390,7 @@ static void trap_rcv_process_request(IN osm_sm_t * sm, Otherwise we start a sweep on the trap 144 caused by cleaning up SM Cap bit... */ - goto Exit; + goto Exit2; /* update the is_gsi flag according to the mgmt_class field */ if (p_madw->p_mad->mgmt_class == IB_MCLASS_SUBN_LID || @@ -406,7 +406,7 @@ static void trap_rcv_process_request(IN osm_sm_t * sm, if (p_smp->method != IB_MAD_METHOD_TRAP) { OSM_LOG(sm->p_log, OSM_LOG_ERROR, "ERR 3801: " "Unsupported method 0x%X\n", p_smp->method); - goto Exit; + goto Exit2; } /* @@ -432,7 +432,7 @@ static void trap_rcv_process_request(IN osm_sm_t * sm, if (sm->p_subn->sm_base_lid == 0) { OSM_LOG(sm->p_log, OSM_LOG_DEBUG, "Received SLID=0 Trap with local LID=0. Ignoring MAD\n"); - goto Exit; + goto Exit2; } OSM_LOG(sm->p_log, OSM_LOG_DEBUG, "Received SLID=0 Trap. Using local LID:%u instead\n", @@ -665,6 +665,7 @@ check_report: Exit: CL_PLOCK_RELEASE(sm->p_lock); +Exit2: OSM_LOG_EXIT(sm->p_log); }