From patchwork Tue Oct 27 22:30:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1388992 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=CDSMyyOB; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CLRH23kbWz9sVD for ; Wed, 28 Oct 2020 09:30:22 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id D9C39862B4; Tue, 27 Oct 2020 22:30:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oUuaQm59W4H2; Tue, 27 Oct 2020 22:30:20 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 565FE8626B; Tue, 27 Oct 2020 22:30:20 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3EA4CC0859; Tue, 27 Oct 2020 22:30:20 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 44364C0051 for ; Tue, 27 Oct 2020 22:30:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 1FE81870C9 for ; Tue, 27 Oct 2020 22:30:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fm-G+KC2aOqw for ; Tue, 27 Oct 2020 22:30:18 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by hemlock.osuosl.org (Postfix) with ESMTPS id 533DA8731B for ; Tue, 27 Oct 2020 22:30:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603837817; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QZwNbmC0j3P7WtQq+Q9hWXTBnbyueE5n80QrkxbbJtc=; b=CDSMyyOBfQL2sHRVJOK46Uw0lOJulYjFM6EtRVYlfgkZMMJSoQCKXKmhbeNllKScGG9LI3 n8c42ac7Iz3NN1xJYMzd2AG3Sj6/IR27FBR8j+9wPttZ3GrBKY9RlJ7SMMALFCLF0dZ6CE 79CfKVW3ZoAcEsDBMq+p84FacxHcO/c= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-203-rDzssFyjPZKIwyhUf4a2hA-1; Tue, 27 Oct 2020 18:30:15 -0400 X-MC-Unique: rDzssFyjPZKIwyhUf4a2hA-1 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 mimecast-mx01.redhat.com (Postfix) with ESMTPS id 85498100746C for ; Tue, 27 Oct 2020 22:30:14 +0000 (UTC) Received: from dceara.remote.csb (ovpn-112-70.ams2.redhat.com [10.36.112.70]) by smtp.corp.redhat.com (Postfix) with ESMTP id 978581992F for ; Tue, 27 Oct 2020 22:30:13 +0000 (UTC) From: Dumitru Ceara To: dev@openvswitch.org Date: Tue, 27 Oct 2020 23:30:10 +0100 Message-Id: <20201027223006.19043.24481.stgit@dceara.remote.csb> In-Reply-To: <20201027222941.19043.84337.stgit@dceara.remote.csb> References: <20201027222941.19043.84337.stgit@dceara.remote.csb> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dceara@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 1/2] pinctrl: Fix memory leak in controller_event_run(). X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Valgrind report: ==4689== 639 (96 direct, 543 indirect) bytes in 3 blocks are definitely lost in loss record 141 of 146 ==4689== at 0x4C29E63: malloc (vg_replace_malloc.c:309) ==4689== by 0x51EEB3: xmalloc (util.c:138) ==4689== by 0x485034: resize (hmap.c:100) ==4689== by 0x4852BF: hmap_expand_at (hmap.c:175) ==4689== by 0x511A8E: hmap_insert_at (hmap.h:283) ==4689== by 0x512824: smap_add__ (smap.c:408) ==4689== by 0x511D20: smap_add (smap.c:55) ==4689== by 0x41B51E: controller_event_run (pinctrl.c:459) ==4689== by 0x422CCD: pinctrl_run (pinctrl.c:3155) ==4689== by 0x433511: main (ovn-controller.c:2588) Fixes: be1eeb09d373 ("OVN: introduce Controller_Event table") Signed-off-by: Dumitru Ceara --- controller/pinctrl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/controller/pinctrl.c b/controller/pinctrl.c index f15afc5..bc482c0 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -465,6 +465,7 @@ controller_event_run(struct ovsdb_idl_txn *ovnsb_idl_txn, sbrec_controller_event_set_seq_num(event, ++event_seq_num); sbrec_controller_event_set_event_info(event, &event_info); sbrec_controller_event_set_chassis(event, chassis); + smap_destroy(&event_info); } } From patchwork Tue Oct 27 22:30:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dumitru Ceara X-Patchwork-Id: 1388993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=ihlzeho1; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CLRHF6LCnz9sV0 for ; Wed, 28 Oct 2020 09:30:33 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5F40186970; Tue, 27 Oct 2020 22:30:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id W9VCwR0pQKne; Tue, 27 Oct 2020 22:30:31 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by whitealder.osuosl.org (Postfix) with ESMTP id 55BB7856C8; Tue, 27 Oct 2020 22:30:31 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 38A93C0859; Tue, 27 Oct 2020 22:30:31 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 26F40C0051 for ; Tue, 27 Oct 2020 22:30:30 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 135E087391 for ; Tue, 27 Oct 2020 22:30:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7HLw6auocHTD for ; Tue, 27 Oct 2020 22:30:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by hemlock.osuosl.org (Postfix) with ESMTPS id 77C588738A for ; Tue, 27 Oct 2020 22:30:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603837828; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hYo8Z9OLfH6lawtXBTdnd75LmtNlnFQqDTIHZZE8miQ=; b=ihlzeho10PRAo8BjdtndFARPxwh7T+4MfUQmYiDJIfkMCyj/b+zO3DprCAUgyS9ycUizLY fgEHI1Q4wf2t6MyXdjf7TR2DMZgQHcvMc3Td3iEarG8HyDIuCwaM87wB9HwxfkN953oQMv 4mJOpdadG+Qmp2+1VL1P10SXHZ3O6DU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-502-fRI2b3AkM0KSvVyjZ3s6CA-1; Tue, 27 Oct 2020 18:30:26 -0400 X-MC-Unique: fRI2b3AkM0KSvVyjZ3s6CA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C34A657203 for ; Tue, 27 Oct 2020 22:30:25 +0000 (UTC) Received: from dceara.remote.csb (ovpn-112-70.ams2.redhat.com [10.36.112.70]) by smtp.corp.redhat.com (Postfix) with ESMTP id 139455B4AC for ; Tue, 27 Oct 2020 22:30:24 +0000 (UTC) From: Dumitru Ceara To: dev@openvswitch.org Date: Tue, 27 Oct 2020 23:30:22 +0100 Message-Id: <20201027223020.19043.40260.stgit@dceara.remote.csb> In-Reply-To: <20201027222941.19043.84337.stgit@dceara.remote.csb> References: <20201027222941.19043.84337.stgit@dceara.remote.csb> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dceara@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH ovn 2/2] pinctrl: Fix memory leak when handling empty lb backends. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Fixes: 7c3523c71932 ("OVN: introduce trigger_event() action") Signed-off-by: Dumitru Ceara --- controller/pinctrl.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/controller/pinctrl.c b/controller/pinctrl.c index bc482c0..08adc10 100644 --- a/controller/pinctrl.c +++ b/controller/pinctrl.c @@ -5744,6 +5744,9 @@ pinctrl_handle_empty_lb_backends_opts(struct ofpbuf *userdata) if (!vip || !protocol || !load_balancer) { static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5); VLOG_WARN_RL(&rl, "missing lb parameters in userdata"); + free(vip); + free(protocol); + free(load_balancer); return false; }