From patchwork Thu Mar 7 14:10:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 2232301 X-Patchwork-Delegate: hal@mellanox.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id EB8DC3FCF6 for ; Thu, 7 Mar 2013 14:10:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754492Ab3CGOKq (ORCPT ); Thu, 7 Mar 2013 09:10:46 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:32952 "EHLO mail-ee0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753478Ab3CGOKp (ORCPT ); Thu, 7 Mar 2013 09:10:45 -0500 Received: by mail-ee0-f41.google.com with SMTP id c13so347804eek.0 for ; Thu, 07 Mar 2013 06:10:44 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=ZrWCkGkMYTUpA96jviEAq7Rjg7cT4ucEBKnIc1cgE6w=; b=BewGZKObHQLwoXIvbGdJLCHZnQhjoeOCBNBCRAXD7jfoxH8sS1Me/pSzxrwdpptUic 5EbkwwLsCqkrfljXi+P6wghSr8I4T2EPtMbbkG7hh+L8r7Pe1U7aNjSz56c5YSLKiagD WSzIRAknpwpc6XRUI9Dx85R9bazwfmfZXhFQ+Tq0IVzRtOnMFwdWZGENcoQlxbsvG127 RgdSTrXD3Mra7hleL/2au2hARUryj8v3tXN4idYhWkFUBabJEb/+NoudlwffopWpcMRc opAORJyfCCbQGLXdjHMjqoMCPX+c5DqVBeFN/gGgz+JEXgeqgyPrBp/JHGxOeHT2P2iR X2Mg== X-Received: by 10.14.173.67 with SMTP id u43mr94109823eel.22.1362665443753; Thu, 07 Mar 2013 06:10:43 -0800 (PST) Received: from [192.168.1.102] (c-71-234-225-85.hsd1.ct.comcast.net. [71.234.225.85]) by mx.google.com with ESMTPS id q42sm2388376eem.14.2013.03.07.06.10.41 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Mar 2013 06:10:42 -0800 (PST) Message-ID: <51389FDF.80608@dev.mellanox.co.il> Date: Thu, 07 Mar 2013 09:10:39 -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)" Subject: [PATCH] opensm/osm_subnet.c: Miscellaneous minor fixes X-Gm-Message-State: ALoCoQk8s+bQS36q6cx+1xwCCqP4CGiXILrHYbwge/ix+WSJAzS0alxQbMChfQNbeLlOLlSPvnEz Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Use strdup in a couple of places where strings were copied Also, fix 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_subnet.c b/opensm/osm_subnet.c index 61a7cc3..f585a42 100644 --- a/opensm/osm_subnet.c +++ b/opensm/osm_subnet.c @@ -1497,7 +1497,7 @@ void osm_subn_set_default_opt(IN osm_subn_opt_t * p_opt) p_opt->dump_files_dir = getenv("OSM_TMP_DIR"); if (!p_opt->dump_files_dir || !(*p_opt->dump_files_dir)) - p_opt->dump_files_dir = OSM_DEFAULT_TMP_DIR; + p_opt->dump_files_dir = strdup(OSM_DEFAULT_TMP_DIR); p_opt->dump_files_dir = strdup(p_opt->dump_files_dir); p_opt->log_file = strdup(OSM_DEFAULT_LOG_FILE); p_opt->log_max_size = 0; @@ -1987,8 +1987,8 @@ int osm_subn_verify_config(IN osm_subn_opt_t * p_opts) else { log_report(" Invalid Cached Option Value:part_enforce = %s" ", Using Default:%s\n", - p_opts->part_enforce = OSM_PARTITION_ENFORCE_BOTH); - p_opts->part_enforce = OSM_PARTITION_ENFORCE_BOTH; + p_opts->part_enforce, OSM_PARTITION_ENFORCE_BOTH); + strcpy(p_opts->part_enforce, OSM_PARTITION_ENFORCE_BOTH); p_opts->part_enforce_enum = OSM_PARTITION_ENFORCE_TYPE_BOTH; } }