From patchwork Sun Apr 26 16:40:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 6276991 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3C005BF4A6 for ; Sun, 26 Apr 2015 16:40:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5ADCE202B4 for ; Sun, 26 Apr 2015 16:40:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9116120266 for ; Sun, 26 Apr 2015 16:40:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750937AbbDZQkn (ORCPT ); Sun, 26 Apr 2015 12:40:43 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:37332 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751850AbbDZQkm (ORCPT ); Sun, 26 Apr 2015 12:40:42 -0400 Received: by widdi4 with SMTP id di4so66534241wid.0 for ; Sun, 26 Apr 2015 09:40:41 -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=jPilPKyOFVOYFTfEg31SXOPf2taiBUu6k/NjovxWZIw=; b=b3FpYs+qjC3uQxq8PMtJYTr7ocHCJamp+YeSS4Wu9cAmM5LIl/+mthv9CV/PordEua jitkFnjf4qtSmv4893VLDM1DIZ2szp+jVTSM3Tn4nQpP7LvV/kI0Asqfq7oLhiOFLaMc UZ58j0vMJyMounK1mJnWFZ03VwWx5juCre6PYegQW+e0qiv0H2+zkiNm4LMsiHo0Gw9+ viRWCxcO1o6UZUAYksjYzPG8jU5WEq54eEacU5xvYzmexBMfDaGLkyQ8sK34HVBUK5WA LaUBQZVNya2v37yRNTbqTag8ZhKPcTbb1TUZTYc9hUB+wTOuUD+9TfFcPZWm04Ro0Fp7 EEQg== X-Gm-Message-State: ALoCoQlhp0vH73tMXq6gmuXcoJgnQCXDbMkAptpUqtWxHgMAA9mzp1+O32iycFCsULlWRkjMDR6E X-Received: by 10.180.78.65 with SMTP id z1mr13738999wiw.14.1430066441114; Sun, 26 Apr 2015 09:40:41 -0700 (PDT) Received: from [10.222.163.49] ([193.47.165.251]) by mx.google.com with ESMTPSA id gy8sm7956465wib.13.2015.04.26.09.40.39 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 26 Apr 2015 09:40:40 -0700 (PDT) Message-ID: <553D14EA.3080703@dev.mellanox.co.il> Date: Sun, 26 Apr 2015 12:40:10 -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: Ira Weiny CC: Vladimir Koushnir , "linux-rdma (linux-rdma@vger.kernel.org)" Subject: [PATCH infiniband-diags] ibqueryerrors: Fix crash when no SM is running 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, T_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: Vladimir Koushnir Date: Tue, 21 Apr 2015 17:12:05 +0300 Handle sa_get_handle error in path_record_query Signed-off-by: Vladimir Koushnir --- src/ibqueryerrors.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c index 8fbb9d1..97a555d 100644 --- a/src/ibqueryerrors.c +++ b/src/ibqueryerrors.c @@ -326,7 +326,9 @@ static int path_record_query(ib_gid_t sgid,uint64_t dguid) uint8_t reversible = 0; struct sa_handle * h; - h = sa_get_handle(); + if (!(h = sa_get_handle())) + return -1; + ibd_timeout = DEFAULT_HALF_WORLD_PR_TIMEOUT; memset(&pr, 0, sizeof(pr));