From patchwork Sun Aug 12 06:44:33 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Netes X-Patchwork-Id: 1309311 X-Patchwork-Delegate: alexne@voltaire.com Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 72D4BDF280 for ; Sun, 12 Aug 2012 06:44:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751171Ab2HLGok (ORCPT ); Sun, 12 Aug 2012 02:44:40 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:50143 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750889Ab2HLGoj (ORCPT ); Sun, 12 Aug 2012 02:44:39 -0400 Received: by weyx8 with SMTP id x8so1836983wey.19 for ; Sat, 11 Aug 2012 23:44:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent:x-gm-message-state; bh=fMvaA0z9u4+S8q3tS/iJLAFJMr1v/I+dHootcam9MCA=; b=RutQb6WBd4hz4i7gE22ogjOT4KhiPJVCOBk20UjbNyb6e3L2N/AZYL6SB3bdsjFcGA yN41fV6GFwVy9RIeFFeBdFfFl6AXaC/Ptt/ZGblhXQh+hiq3zF6SFcc5kPQGoSI0Sc/8 mLnThoSDnpG2MxymfTAZE8KEinvejFaxX3r9sgcRHeDITR5mviJ5sj/Hu1RMPe9JK/dC q33DUQzwtF2NBD/pJcqKgAX3kQNrtaPcp6iLn1dT8uKAUikpE/rMpl71GTaOfeEtcTRL 20z6QluI4ir2B+klE0+RXSlF4UdBhznU2EU9XvjK4JMzEQ2rq18DPGiKTIvM+HxMvEqY aueg== Received: by 10.180.75.209 with SMTP id e17mr10354254wiw.0.1344753878394; Sat, 11 Aug 2012 23:44:38 -0700 (PDT) Received: from localhost ([193.47.165.251]) by mx.google.com with ESMTPS id dc3sm8410538wib.7.2012.08.11.23.44.35 (version=SSLv3 cipher=OTHER); Sat, 11 Aug 2012 23:44:37 -0700 (PDT) Date: Sun, 12 Aug 2012 09:44:33 +0300 From: Alex Netes To: linux-rdma@vger.kernel.org, Jens Domke Cc: Torsten Hoefler Subject: [PATCH] opensm: fix crash in DFSSSP routing engine on reroute Message-ID: <20120812064433.GA14539@calypso> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQnUcCUFJ0I0nKYQXR3uRbr+VQL8DFIxFlksIbVqSyurbg+EJdot8o70biZ0/wDaFFioxW3T Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Routing engine should delete the context only when calling delete function. Found-and-fixed-by: Jens Domke Signed-off-by: Alex Netes --- opensm/osm_ucast_dfsssp.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/opensm/osm_ucast_dfsssp.c b/opensm/osm_ucast_dfsssp.c index d6d65b1..ffc317f 100644 --- a/opensm/osm_ucast_dfsssp.c +++ b/opensm/osm_ucast_dfsssp.c @@ -2135,12 +2135,11 @@ static void dfsssp_context_destroy(void *context) } free(adj_list); dfsssp_ctx->adj_list = NULL; + dfsssp_ctx->adj_list_size = 0; /* free srcdest2vl table (can be done because, dfsssp_context_destroy is called after osm_get_dfsssp_sl) */ vltable_dealloc(&(dfsssp_ctx->srcdest2vl_table)); dfsssp_ctx->srcdest2vl_table = NULL; - - free(context); } static void delete(void *context) @@ -2148,6 +2147,8 @@ static void delete(void *context) if (!context) return; dfsssp_context_destroy(context); + + free(context); } int osm_ucast_dfsssp_setup(struct osm_routing_engine *r, osm_opensm_t * p_osm)