From patchwork Thu Nov 29 11:07:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Honggang LI X-Patchwork-Id: 10704437 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A714913AD for ; Thu, 29 Nov 2018 11:07:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 991C52EE32 for ; Thu, 29 Nov 2018 11:07:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CEA62EE41; Thu, 29 Nov 2018 11:07:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 390982EE32 for ; Thu, 29 Nov 2018 11:07:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726870AbeK2WMz (ORCPT ); Thu, 29 Nov 2018 17:12:55 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53906 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726621AbeK2WMz (ORCPT ); Thu, 29 Nov 2018 17:12:55 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B97FC0669DD; Thu, 29 Nov 2018 11:07:56 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-12-72.pek2.redhat.com [10.72.12.72]) by smtp.corp.redhat.com (Postfix) with ESMTP id CF84316D26; Thu, 29 Nov 2018 11:07:54 +0000 (UTC) From: Honggang Li To: hal@dev.mellanox.co.il Cc: linux-rdma@vger.kernel.org Subject: [opensm patch 2/2] osm_opensm.c: destroy_routing_engines should destory the default routing engine Date: Thu, 29 Nov 2018 06:07:50 -0500 Message-Id: <20181129110750.5276-2-honli@redhat.com> In-Reply-To: <20181129110750.5276-1-honli@redhat.com> References: <20181129110750.5276-1-honli@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 29 Nov 2018 11:07:56 +0000 (UTC) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Honggang Li --- opensm/osm_opensm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/opensm/osm_opensm.c b/opensm/osm_opensm.c index be867fee..f73d0fa3 100644 --- a/opensm/osm_opensm.c +++ b/opensm/osm_opensm.c @@ -276,6 +276,13 @@ static void destroy_routing_engines(osm_opensm_t *osm) r->destroy(r->context); free(r); } + + r = osm->default_routing_engine; + if (r) { + if (r->destroy) + r->destroy(r->context); + free(r); + } } static void destroy_plugins(osm_opensm_t *osm)