From patchwork Mon Jul 16 08:57:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 1200331 X-Patchwork-Delegate: alexne@voltaire.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 E2DFB3FD9C for ; Mon, 16 Jul 2012 08:57:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751497Ab2GPI5o (ORCPT ); Mon, 16 Jul 2012 04:57:44 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:62316 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751354Ab2GPI5o (ORCPT ); Mon, 16 Jul 2012 04:57:44 -0400 Received: by bkwj10 with SMTP id j10so4459965bkw.19 for ; Mon, 16 Jul 2012 01:57:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent:x-gm-message-state; bh=xDcpPUsUH0oa/UH/7tsHjS/ewoqXqBMmUd7heitf1fQ=; b=ovfhRpFVS5YyHhEaSwSLbEBnq2DpDm6pxfpbeUaj7D9+7p8xDchTErcOTQcLAFlcSf HX2/LoqHa0uNi8FGpoQQNu2j7ZiMB5DRBuo503cmjunjc3v/vakA6SGBrLwBZXzNLgKD vqmJaEhrPFyXGsLcHIvR0+Cv6Au9Rb27vG0FOstz6+M038RYnBS49PzbQ4W2gx7g36FU kvH9txL4rWzpS8nQqmdX9MdRt9piRdzp89npIfb/bYg2UvRjW5f7X3hovnNlSfbVPVAP xeLBBIkGcsp3qKZiJuWhTClgTinloO6qPJ51VppvDxFZGEEqOuzn2vgFXVnIwoTviWcA VULQ== Received: by 10.204.152.4 with SMTP id e4mr4356182bkw.2.1342429062163; Mon, 16 Jul 2012 01:57:42 -0700 (PDT) Received: from localhost ([193.47.165.251]) by mx.google.com with ESMTPS id fu8sm7505178bkc.5.2012.07.16.01.57.40 (version=SSLv3 cipher=OTHER); Mon, 16 Jul 2012 01:57:41 -0700 (PDT) Date: Mon, 16 Jul 2012 11:57:38 +0300 From: Alex Netes To: linux-rdma@vger.kernel.org Subject: [PATCH] opensm: fix part_enforce parameter parsing crash Message-ID: <20120716085738.GA3470@calypso> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQk9BQKGVm0ucTt3vSThuUmHHgr3ZdFKpugZj2v2+l2bFtWdhxLI40Zki1Ym8//dr3B+bkkw Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org The default setting should use strdup, otherwise if set to different value, opensm will crash on parsing. Signed-off-by: Vladimir Koushnir Signed-off-by: Alex Netes --- opensm/osm_subnet.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/opensm/osm_subnet.c b/opensm/osm_subnet.c index 88b68d0..7372945 100644 --- a/opensm/osm_subnet.c +++ b/opensm/osm_subnet.c @@ -697,6 +697,7 @@ static void subn_opt_destroy(IN osm_subn_opt_t * p_opt) free(p_opt->partition_config_file); free(p_opt->qos_policy_file); free(p_opt->dump_files_dir); + free(p_opt->part_enforce); free(p_opt->lid_matrix_dump_file); free(p_opt->lfts_file); free(p_opt->root_guid_file); @@ -1178,7 +1179,7 @@ void osm_subn_set_default_opt(IN osm_subn_opt_t * p_opt) p_opt->log_max_size = 0; p_opt->partition_config_file = strdup(OSM_DEFAULT_PARTITION_CONFIG_FILE); p_opt->no_partition_enforcement = FALSE; - p_opt->part_enforce = OSM_PARTITION_ENFORCE_BOTH; + p_opt->part_enforce = strdup(OSM_PARTITION_ENFORCE_BOTH); p_opt->allow_both_pkeys = FALSE; p_opt->sm_assigned_guid = 0; p_opt->qos = FALSE;