From patchwork Sat Jan 4 16:47:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 3433811 X-Patchwork-Delegate: hal@mellanox.com 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C1240C02DC for ; Sat, 4 Jan 2014 16:47:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E183C20158 for ; Sat, 4 Jan 2014 16:47:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 348CC20145 for ; Sat, 4 Jan 2014 16:47:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754814AbaADQrc (ORCPT ); Sat, 4 Jan 2014 11:47:32 -0500 Received: from mail-ea0-f175.google.com ([209.85.215.175]:54233 "EHLO mail-ea0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754513AbaADQrb (ORCPT ); Sat, 4 Jan 2014 11:47:31 -0500 Received: by mail-ea0-f175.google.com with SMTP id z10so7143190ead.20 for ; Sat, 04 Jan 2014 08:47:30 -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=mGeHvnlfQgv7x95y3wW5ucOjqSFK0R1jF/vePEnkSb8=; b=ma58bAHr0Obrfi7ZP6l91fAhxrDxOQ4j8or4EuJu1qIM8i0CbWhsU6kvaYPC2VHMoa TTsBUK44+ybk+ezqAuTbePbnieriGzo7SIztZ3Bp1b8gvUCl1vjGv2HC0CNDab1UkztH ugZq9Vyh/Xkd4EI3bNP3vzq3Fm+T6nA5AjpjfqP/tkLkBTGcrEg8hK9ZjBS54qmfF44P V1QrAdwDYYqn9PvtyJIaMgthea/9HR2A3rdTUsZNUICnITJDTwgfpIBSOOcFw0HHpDcd 49f3xfCgCzwKTFNDCiiNWXHfoG9jUfbjhuf+qKcj2Ix/oV2s6Ni46ccZk7mcmXBP3Wsr u98w== X-Gm-Message-State: ALoCoQlSIqvBLG7ZuK9+cUCVEKUN5RjKIRGEK8M3CfydkVl1kSpv7jrrlvzyEu0xBt6fueJ1IAPq X-Received: by 10.15.23.206 with SMTP id h54mr80280931eeu.17.1388854050138; Sat, 04 Jan 2014 08:47:30 -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 g47sm154824837eeo.19.2014.01.04.08.47.28 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 04 Jan 2014 08:47:29 -0800 (PST) Message-ID: <52C83B1D.3060909@dev.mellanox.co.il> Date: Sat, 04 Jan 2014 11:47:25 -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: Bart Van Assche Subject: [PATCH opensm] osm_db_files.c: Fix issue introduced in commit, aaa7b1e67ec6e5fc2a10accf46d538f9d47c6323 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.3 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 osm_db_files.c: Some minor fixes/improvements to osm_db_store when handling malloc failure, no need to release lock Signed-off-by: Hal Rosenstock --- opensm/osm_db_files.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/opensm/osm_db_files.c b/opensm/osm_db_files.c index b43b5e6..07d30dc 100644 --- a/opensm/osm_db_files.c +++ b/opensm/osm_db_files.c @@ -480,7 +480,7 @@ int osm_db_store(IN osm_db_domain_t * p_domain, if (!p_tmp_file_name) { OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 6113: " "Failed to allocate memory for temporary file name\n"); - goto Exit; + goto Exit2; } strcpy(p_tmp_file_name, p_domain_imp->file_name); strcat(p_tmp_file_name, ".tmp"); @@ -533,6 +533,7 @@ int osm_db_store(IN osm_db_domain_t * p_domain, p_domain_imp->dirty = FALSE; Exit: cl_spinlock_release(&p_domain_imp->lock); free(p_tmp_file_name); +Exit2: OSM_LOG_EXIT(p_log); return status;