From patchwork Thu Sep 12 13:44:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2878471 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 1628D9F1C0 for ; Thu, 12 Sep 2013 13:44:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB82920357 for ; Thu, 12 Sep 2013 13:44:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D2D6A2034D for ; Thu, 12 Sep 2013 13:44:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751404Ab3ILNo1 (ORCPT ); Thu, 12 Sep 2013 09:44:27 -0400 Received: from mail-bk0-f43.google.com ([209.85.214.43]:47783 "EHLO mail-bk0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899Ab3ILNo1 (ORCPT ); Thu, 12 Sep 2013 09:44:27 -0400 Received: by mail-bk0-f43.google.com with SMTP id mz13so4283044bkb.30 for ; Thu, 12 Sep 2013 06:44:26 -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=JtYQr+IKSjUcO9rCH8+29eo3ubVUF6bZG7vETTv7Unw=; b=JvjzbMXt/atI5rjYwuVXy2bPm9dVz9MPHdOWB0YpQBKQkQSTPQGaHj1M+M5Ng0PDyy PhYyKPIMR99ZPQkH3Skt7Fw1niPUBAdKYUmsxE03KkpSZEVyJgnuSFqd80VEURxKLSmk hIYW0d6sjnck3Xj0YVUpF1XZGdbC02hzH5x3GaCbGCu/6TsFOk9b+WoebnJT5q7Cwaoq CJDueZXb+x52edbpij7BhTie3ESV6IQK48xLPgHXQfAQToucnHKXKm9J4hqBRKhLJljz 31OR4GaECH93H7AkstccEEEFlnKxgBsObayTYok7D5ZXT4WSkUhJXo+5jLFg2kVZrpHY 7ffg== X-Gm-Message-State: ALoCoQkA5uENg9iZu3I2hAUBZnrEyC6o7WcYiLJeIu2DJ2yfigixakW1/ADtsBKBiXYfhbIiRVLU X-Received: by 10.205.10.132 with SMTP id pa4mr6657832bkb.15.1378993466167; Thu, 12 Sep 2013 06:44:26 -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 no2sm1185895bkb.15.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Sep 2013 06:44:25 -0700 (PDT) Message-ID: <5231C537.3070102@dev.mellanox.co.il> Date: Thu, 12 Sep 2013 09:44:23 -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: Line Holen Subject: [PATCH opensm] osm_db_files.c: Add osm_db_domain_init failure handling into test program 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.8 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 Also, improve error 6100 log message Signed-off-by: Hal Rosenstock --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/opensm/osm_db_files.c b/opensm/osm_db_files.c index 9219722..10389da 100644 --- a/opensm/osm_db_files.c +++ b/opensm/osm_db_files.c @@ -162,7 +162,8 @@ int osm_db_init(IN osm_db_t * p_db, IN osm_log_t * p_log) p_db_imp = malloc(sizeof(osm_db_imp_t)); if (!p_db_imp) { - OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 6100: No memory.\n"); + OSM_LOG(p_log, OSM_LOG_ERROR, "ERR 6100: " + "Failed to allocate db memory\n"); return -1; } @@ -668,6 +669,10 @@ int main(int argc, char **argv) } p_dbd = osm_db_domain_init(&db, "lid_by_guid"); + if (!p_dbd) { + printf("db domain init failed\n"); + exit(1); + } if (osm_db_restore(p_dbd)) { printf("failed to restore\n");