From patchwork Wed Sep 11 21:18:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Sun X-Patchwork-Id: 1161296 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YyS+hEir"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46TFGW4tskz9sDB for ; Thu, 12 Sep 2019 07:22:11 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 36EBDE0E; Wed, 11 Sep 2019 21:18:50 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id C128ED91 for ; Wed, 11 Sep 2019 21:18:47 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 75EDF82B for ; Wed, 11 Sep 2019 21:18:47 +0000 (UTC) Received: by mail-pg1-f194.google.com with SMTP id n9so12190877pgc.1 for ; Wed, 11 Sep 2019 14:18:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QpdxWLodp2bz00/9cul/4U3jRkdvqiB0a0UGZGyMujU=; b=YyS+hEirdZ+Du1UqDsjR9NxvO4NsY6krws6fuZPteq75+5P1zbCJeEICEssDQmCjzS RUdWewpJd8kCxr0dBx6Yx934uN4/X4vm4NGGFviRatLKmg0k+fOofB8M8zhgVgONG3Ys dmmDcgRNVX+EYBVhWm+GclfMlePOMQMkK8OKTi7A+nyCXEs3GSGZdSv65lDDOMU5Jb54 VhREMWEeMYsqwyx8Os0O8uSHmudcbpNeOInek6xSBWEDf88UeoX+4FD+mxy7JKMD+A6v UyWTrRjEgg88ToBzrFUhMOW26DPyLCpxD5Enj1uyv+90S/Ejd5nnF52C0jWOXtSk7YWD g4Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=QpdxWLodp2bz00/9cul/4U3jRkdvqiB0a0UGZGyMujU=; b=ZeraHoHqjcErs2gGScH/eNhP8bhRv+Vm3Xpsu3UWWnC2erg/o3KRdVTSBCkcVGrs2j ug4WZfxNEhfmnKd3/+YEtdGnvJps5+aHkwwL+DccgknFsabKW8ukhzQKQHLqjO/feU2Z zYVhUap6tFQ7hxwA08VXcyqeLmAM3uDOp/0tHblqbx2FBZefCRiJW+pSmBWtVWjF6sM7 stCHvE0YVDhUnxG3ZHZLXarx9nBrkbkcSyFs1iStfIceFQV92YDfYy9dDHkJKMDABIVq IBWX/XsJyygYfeYZMWrs2seO31Ui57fmvbUAH4akZ9t8JP/YdiRosHom3+Mp9F0XmsZO MiIw== X-Gm-Message-State: APjAAAVdL1kOJ5kiNyvaLAhO/P1eo0T831BIZH8BcNpyZkONCZwRNZ8a JkSscE82x0pCBQsGpJVCj+j6TCcT X-Google-Smtp-Source: APXvYqwhMILNh8U2tdVeZQWM7nI3j95gEbZ6suFZ2qz4XBju0WCPfG2F3CbMYM4logcqCiuY/V17kQ== X-Received: by 2002:a17:90a:1c01:: with SMTP id s1mr7949352pjs.76.1568236726961; Wed, 11 Sep 2019 14:18:46 -0700 (PDT) Received: from kern417.eng.vmware.com ([66.170.99.1]) by smtp.gmail.com with ESMTPSA id k1sm24612487pfi.132.2019.09.11.14.18.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Sep 2019 14:18:46 -0700 (PDT) From: Yifeng Sun To: dev@openvswitch.org Date: Wed, 11 Sep 2019 14:18:34 -0700 Message-Id: <1568236716-18105-8-git-send-email-pkusunyifeng@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1568236716-18105-1-git-send-email-pkusunyifeng@gmail.com> References: <1568236716-18105-1-git-send-email-pkusunyifeng@gmail.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH 08/10] ofproto-dpif: Free leaked 'webster' X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org Valgrind reported: 1122: ofproto-dpif - select group with explicit dp_hash selection method ==16884== 64 bytes in 1 blocks are definitely lost in loss record 320 of 346 ==16884== at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==16884== by 0x532512: xcalloc (util.c:121) ==16884== by 0x4262B9: group_setup_dp_hash_table (ofproto-dpif.c:4846) ==16884== by 0x4267CB: group_set_selection_method (ofproto-dpif.c:4938) ==16884== by 0x4267CB: group_construct (ofproto-dpif.c:4984) ==16884== by 0x417250: init_group (ofproto.c:7286) ==16884== by 0x41B4FC: add_group_start (ofproto.c:7316) ==16884== by 0x42247A: ofproto_group_mod_start (ofproto.c:7589) ==16884== by 0x4250EC: handle_group_mod (ofproto.c:7744) ==16884== by 0x4250EC: handle_single_part_openflow (ofproto.c:8428) ==16884== by 0x4250EC: handle_openflow (ofproto.c:8606) ==16884== by 0x4579E2: ofconn_run (connmgr.c:1318) ==16884== by 0x4579E2: connmgr_run (connmgr.c:355) ==16884== by 0x41E0F5: ofproto_run (ofproto.c:1845) ==16884== by 0x40BA63: bridge_run__ (bridge.c:2971) ==16884== by 0x410CF3: bridge_run (bridge.c:3029) ==16884== by 0x407614: main (ovs-vswitchd.c:127) This patch fixes it. Signed-off-by: Yifeng Sun Acked-by: William Tu --- ofproto/ofproto-dpif.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 46fa1357163b..7bb0f7bdb4f3 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -4871,6 +4871,7 @@ group_setup_dp_hash_table(struct group_dpif *group, size_t max_hash) if (n_hash > MAX_SELECT_GROUP_HASH_VALUES || (max_hash != 0 && n_hash > max_hash)) { VLOG_DBG(" Too many hash values required: %"PRIu64, n_hash); + free(webster); return false; }