From patchwork Fri Aug 12 00:20:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesse Gross X-Patchwork-Id: 658466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3s9QY63qzDz9sC4 for ; Fri, 12 Aug 2016 10:21:30 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id BE67A10C88; Thu, 11 Aug 2016 17:21:28 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id F2E0310C87 for ; Thu, 11 Aug 2016 17:21:27 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 6802B1E0311 for ; Thu, 11 Aug 2016 18:21:27 -0600 (MDT) X-ASG-Debug-ID: 1470961287-09eadd388013d60001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar5.cudamail.com with ESMTP id 8rk12ge9pEtEQPHV (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 11 Aug 2016 18:21:27 -0600 (MDT) X-Barracuda-Envelope-From: jesse@kernel.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mail.kernel.org) (198.145.29.136) by mx1-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 12 Aug 2016 00:21:26 -0000 Received-SPF: none (mx1-pf1.cudamail.com: domain at kernel.org does not designate permitted sender hosts) X-Barracuda-Apparent-Source-IP: 198.145.29.136 X-Barracuda-RBL-IP: 198.145.29.136 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 88DA3200F0 for ; Fri, 12 Aug 2016 00:21:25 +0000 (UTC) Received: from localhost.localdomain (c-71-202-123-143.hsd1.ca.comcast.net [71.202.123.143]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8A62D202A1 for ; Fri, 12 Aug 2016 00:21:24 +0000 (UTC) X-CudaMail-Envelope-Sender: jesse@kernel.org From: Jesse Gross To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-810085562 X-CudaMail-DTE: 081116 X-CudaMail-Originating-IP: 198.145.29.136 Date: Thu, 11 Aug 2016 17:20:32 -0700 X-ASG-Orig-Subj: [##CM-E1-810085562##][PATCH rebase 1/3] ovn-controller: Fix memory leak when updating tunnels. Message-Id: <1470961234-90115-2-git-send-email-jesse@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1470961234-90115-1-git-send-email-jesse@kernel.org> References: <1470961234-90115-1-git-send-email-jesse@kernel.org> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, 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 X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1470961287 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Subject: [ovs-dev] [PATCH rebase 1/3] ovn-controller: Fix memory leak when updating tunnels. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" When a tunnel possibly needs to be updated, we are currently allocating a new name for it. This is not necessary and in fact nothing uses the name, which then results in the memory being leaked. Fixes: 1d45d5a9 ("ovn-controller: Change encaps_run to work incrementally.") Signed-off-by: Jesse Gross Acked-by: Ryan Moats Acked-by: Ben Pfaff --- ovn/controller/encaps.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ovn/controller/encaps.c b/ovn/controller/encaps.c index 3bb8ae4..6623f19 100644 --- a/ovn/controller/encaps.c +++ b/ovn/controller/encaps.c @@ -309,12 +309,7 @@ check_and_update_tunnel(const struct sbrec_chassis *chassis_rec) const struct sbrec_encap *encap = preferred_encap(chassis_rec); const struct ovsrec_port *port = port_node->port; const struct ovsrec_interface *iface = port->interfaces[0]; - char *port_name = tunnel_create_name(chassis_rec->name); - if (!port_name) { - VLOG_WARN("Unable to allocate unique name for '%s' tunnel", - chassis_rec->name); - return; - } + if (strcmp(encap->type, iface->type)) { ovsrec_interface_set_type(iface, encap->type); }