From patchwork Thu Aug 12 15:57:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Van Haaren, Harry" X-Patchwork-Id: 1516369 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.136; helo=smtp3.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4GlrwN1pBKz9sX3 for ; Fri, 13 Aug 2021 01:59:16 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 84927614B8; Thu, 12 Aug 2021 15:59:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id jG0sL8MFNS8l; Thu, 12 Aug 2021 15:59:10 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id E692C6147E; Thu, 12 Aug 2021 15:59:07 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id C3B77C0022; Thu, 12 Aug 2021 15:59:07 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 72062C0022 for ; Thu, 12 Aug 2021 15:59:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 1FB31407D7 for ; Thu, 12 Aug 2021 15:58:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i0cVvB_H1MP5 for ; Thu, 12 Aug 2021 15:58:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by smtp2.osuosl.org (Postfix) with ESMTPS id 27D4F407DD for ; Thu, 12 Aug 2021 15:58:07 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10074"; a="202573091" X-IronPort-AV: E=Sophos;i="5.84,316,1620716400"; d="scan'208";a="202573091" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2021 08:57:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,316,1620716400"; d="scan'208";a="527871946" Received: from silpixa00401089.ir.intel.com ([10.55.129.12]) by fmsmga002.fm.intel.com with ESMTP; 12 Aug 2021 08:57:42 -0700 From: Harry van Haaren To: dev@openvswitch.org Date: Thu, 12 Aug 2021 15:57:34 +0000 Message-Id: <20210812155735.3113912-1-harry.van.haaren@intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210812151134.3113110-1-harry.van.haaren@intel.com> References: <20210812151134.3113110-1-harry.van.haaren@intel.com> MIME-Version: 1.0 Cc: kumar.amber@intel.com, i.maximets@ovn.org Subject: [ovs-dev] [PATCH v2 1/2] dpif-netdev: fix memory leak in dpcls subtable set command 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" This patch fixes a memory leak when the command "dpif-netdev/subtable-lookup-prio-set" is run, the pmd_list required to iterate the PMD threads was not being freed. This issue was identified by a static analysis tool. Fixes: 3d018c3e ("dpif-netdev: Add subtable lookup prio set command.") Signed-off-by: Harry van Haaren Acked-by: Kevin Traynor --- Maintainers, please consider applying this patch to 2.14 and 2.15, which are expected to have the same issue as fixed here. --- lib/dpif-netdev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index 03f460c7d1..9e0d5c3103 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -994,6 +994,7 @@ dpif_netdev_subtable_lookup_set(struct unixctl_conn *conn, int argc OVS_UNUSED, /* release port mutex before netdev mutex. */ ovs_mutex_unlock(&dp->port_mutex); + free(pmd_list); } ovs_mutex_unlock(&dp_netdev_mutex);