From patchwork Wed Jun 8 16:04:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thadeu Lima de Souza Cascardo X-Patchwork-Id: 632366 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 3rPtYB19R4z9sXR for ; Thu, 9 Jun 2016 02:04:28 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 356CB10A08; Wed, 8 Jun 2016 09:04:26 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id DC57410A07 for ; Wed, 8 Jun 2016 09:04:24 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 45698162488 for ; Wed, 8 Jun 2016 10:04:24 -0600 (MDT) X-ASG-Debug-ID: 1465401861-0b3237720204890001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar6.cudamail.com with ESMTP id gwtHd3K0oVxRm6ZO (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 08 Jun 2016 10:04:21 -0600 (MDT) X-Barracuda-Envelope-From: cascardo@redhat.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mx1.redhat.com) (209.132.183.28) by mx1-pf2.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 8 Jun 2016 16:04:21 -0000 Received-SPF: pass (mx1-pf2.cudamail.com: SPF record at _spf1.redhat.com designates 209.132.183.28 as permitted sender) X-Barracuda-Apparent-Source-IP: 209.132.183.28 X-Barracuda-RBL-IP: 209.132.183.28 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3DFC96439F for ; Wed, 8 Jun 2016 16:04:20 +0000 (UTC) Received: from indiana.gru.redhat.com (ovpn-116-43.phx2.redhat.com [10.3.116.43]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u58G4ISl019464 for ; Wed, 8 Jun 2016 12:04:19 -0400 X-CudaMail-Envelope-Sender: cascardo@redhat.com From: Thadeu Lima de Souza Cascardo To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E2-607038867 X-CudaMail-DTE: 060816 X-CudaMail-Originating-IP: 209.132.183.28 Date: Wed, 8 Jun 2016 13:04:11 -0300 X-ASG-Orig-Subj: [##CM-E2-607038867##][PATCH] ofproto-dpif-upcall: prevent memory leak on log message Message-Id: <1465401851-30232-1-git-send-email-cascardo@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 08 Jun 2016 16:04:20 +0000 (UTC) X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1465401861 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA 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] ofproto-dpif-upcall: prevent memory leak on log message 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 DPIF does not support UFID (like old kernels), it may print this message quite frequently, if using an OVS version that does not include the upstream fix af50de8 ("ofproto-dpif-upcall: Pass key to dpif_flow_get()."). Signed-off-by: Thadeu Lima de Souza Cascardo Fixes: af50de8 ("ofproto-dpif-upcall: Pass key to dpif_flow_get().") --- ofproto/ofproto-dpif-upcall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ofproto/ofproto-dpif-upcall.c b/ofproto/ofproto-dpif-upcall.c index 1374950..a18fc5a 100644 --- a/ofproto/ofproto-dpif-upcall.c +++ b/ofproto/ofproto-dpif-upcall.c @@ -2056,6 +2056,7 @@ log_unexpected_flow(const struct dpif_flow *flow, int error) "unexpected flow (%s): ", ovs_strerror(error)); odp_format_ufid(&flow->ufid, &ds); VLOG_WARN_RL(&rl, "%s", ds_cstr(&ds)); + ds_destroy(&ds); } static void