From patchwork Tue Sep 20 15:35:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Moats X-Patchwork-Id: 672326 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 3sdn0J5DgGz9s5g for ; Wed, 21 Sep 2016 01:36:00 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id AC119105ED; Tue, 20 Sep 2016 08:35:57 -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 AA9EC10569 for ; Tue, 20 Sep 2016 08:35:55 -0700 (PDT) Received: from bar5.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 084D21E0112 for ; Tue, 20 Sep 2016 09:35:55 -0600 (MDT) X-ASG-Debug-ID: 1474385754-09eadd353379f340001-byXFYA Received: from mx3-pf1.cudamail.com ([192.168.14.2]) by bar5.cudamail.com with ESMTP id qcLhWD2RaNGLC5Aq (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 20 Sep 2016 09:35:54 -0600 (MDT) X-Barracuda-Envelope-From: ryanmoats@ryans-macbook-pro-4.local X-Barracuda-RBL-Trusted-Forwarder: 192.168.14.2 Received: from unknown (HELO fed1rmfepo103.cox.net) (68.230.241.145) by mx3-pf1.cudamail.com with SMTP; 20 Sep 2016 15:35:53 -0000 Received-SPF: none (mx3-pf1.cudamail.com: domain at ryans-macbook-pro-4.local does not designate permitted sender hosts) X-Barracuda-Apparent-Source-IP: 68.230.241.145 X-Barracuda-RBL-IP: 68.230.241.145 Received: from fed1rmimpo306.cox.net ([68.230.241.174]) by fed1rmfepo103.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20160920153553.SFQT4001.fed1rmfepo103.cox.net@fed1rmimpo306.cox.net> for ; Tue, 20 Sep 2016 11:35:53 -0400 Received: from Ryans-MacBook-Pro-4.local ([68.13.3.105]) by fed1rmimpo306.cox.net with cox id lrbq1t00l2FwX1Q01rbrtv; Tue, 20 Sep 2016 11:35:52 -0400 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A090202.57E15758.00C3, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.1 cv=bOG2WKKZ c=1 sm=1 tr=0 a=dOnThDWq1HkKqEbmY+uBSw==:117 a=dOnThDWq1HkKqEbmY+uBSw==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=GW1xBdLrtEIA:10 a=VnNF1IyMAAAA:8 a=ldU9MjaEeszgkweSrnwA:9 a=skCgnbhlp52w9zbo2JeP:22 X-CM-Score: 0.00 Authentication-Results: cox.net; none Received: by Ryans-MacBook-Pro-4.local (Postfix, from userid 501) id 9A3C17327F1; Tue, 20 Sep 2016 10:35:49 -0500 (CDT) X-CudaMail-Envelope-Sender: ryanmoats@ryans-macbook-pro-4.local From: Ryan Moats To: dev@openvswitch.org X-CudaMail-MID: CM-V1-919025360 X-CudaMail-DTE: 092016 X-CudaMail-Originating-IP: 68.230.241.145 Date: Tue, 20 Sep 2016 10:35:46 -0500 X-ASG-Orig-Subj: [##CM-V1-919025360##][PATCH] ofproto-dpif-xlate: Fix memory leak in execute_controller_action. Message-Id: <1474385746-79700-1-git-send-email-rmoats@us.ibm.com> X-Mailer: git-send-email 2.7.0 X-GBUdb-Analysis: 0, 68.230.241.145, Ugly c=0.405176 p=-0.0980392 Source Normal X-MessageSniffer-Rules: 0-0-0-3800-c X-Barracuda-Connect: UNKNOWN[192.168.14.2] X-Barracuda-Start-Time: 1474385754 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.33070 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Subject: [ovs-dev] [PATCH] ofproto-dpif-xlate: Fix memory leak in execute_controller_action. 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" commit df70a7731 ("ofproto-dpif-xlate: Allow translating without side-effects.") created a memory leak by removing the dp_packet_delete statement in execute_controller_action that freed the earlier cloned packet. This commit restores this statement to the end of the method. This issue is only seen in the master branch. Fixes: df70a7731 ("ofproto-dpif-xlate: Allow translating without side-effects.") Signed-off-by: Ryan Moats --- ofproto/ofproto-dpif-xlate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index f17cb79..71ffca0 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -3648,6 +3648,8 @@ execute_controller_action(struct xlate_ctx *ctx, int len, entry->controller.ofproto = ctx->xbridge->ofproto; entry->controller.am = am; } + + dp_packet_delete(packet); } static void