From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id DDA64A034E; Tue, 22 Feb 2022 19:19:38 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CFD22411A7; Tue, 22 Feb 2022 19:19:11 +0100 (CET) Received: from out203-205-221-233.mail.qq.com (out203-205-221-233.mail.qq.com [203.205.221.233]) by mails.dpdk.org (Postfix) with ESMTP id 7C8F8411A7 for ; Tue, 22 Feb 2022 19:19:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1645553947; bh=AuLDVMGbbOBTXeoJiwybOEPLIguDnETqNo5NOGxMDNs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=r0Y9pzoIaQemUQM0UAbiePWhPCl0L9rFtL+2hW63Wf8MaBBoOvTrAD59ws8mzP08a t0/50Utjtmbc1CCM04JvrWRJ/PHG5ZwlSoTJtzDlJgnmWMUQJwFjoKIfHcJFmNDptm ieavkJrTIYUo+OrIFw4ze53+sumV9VNACDWENqzg= Received: from localhost.localdomain ([111.193.130.237]) by newxmesmtplogicsvrszc6.qq.com (NewEsmtp) with SMTP id 49223207; Wed, 23 Feb 2022 02:18:18 +0800 X-QQ-mid: xmsmtpt1645553943tee7gqf1j Message-ID: X-QQ-XMAILINFO: N+AV0Bxqx93JUO1PRIjNY3BZV3TgvI6X17IhAUZgE+VCjXFOyY5nHpUHr7aRxH h5n2/LI4jiPvVZVjPEfXsouUGY8P9mWCKeUOiHBViVHiWpNsNgRUSY0kGCgLJaCYRXHGNM0dSjbf +PGznTYU2qTqozuABv0ScGfjazHTN7ZBWU5GvF7l/HfOQ07kPKFZRzrbjx1qFmxxjOPcBOF9gPKa OFw2nWhErBsJXivSJAX1O2+qZHi1ru2n3KXkcbmmzTTBK3h8qOjVnVJbH3NzeUnL2lmKs8nyVC/M ReiFbmep1QZYQhERFqqz2HLYw7YIaXEig4BI/gl9pGfQRed6GjMKA2CQPRRchEtb6TnUyJvJbq2e IfvxPMOTegLnElPnThJCjqZiSDDvSXbWhpNm6eSd/naUSnw468svL2TraeuWKU9CLOFXaDxfvzvz y1OSnIyLZEHLq+TACowynQIAosRc0cB66eSYU7r294QiLGky/EO6HmqScKzLwyxzcV5JWdmQSVg9 U26Y2qmURZsV+elbvOy3X0MnZJiHOSnWx4M2xQfh8NMytuxYLjO+rc2xTVhpc/o/eJilA4tKThQu erxvObrH2l5LTAiOpVxo1622NmjVK6DIkVYoDgX7eWSkyYl8WdMQlNmb38SC5bfcKvi4BrTr2urz cwJpRhDB8Qq7yimvAwOGvSpfo+xkbncIp6fmX7bU0fUPkvk3zGHe1yAj7rbOg7xYsdJ3W7MwsPPU EFV+BhxixsAJ/YIwTDG5d3vtmoQO0db8lrisrNhEcu6KuPt3uzuqf9L6p8/BoEoWov0kKA6Ix6T1 52w2yTkFf3uBvXsBrXq09QwTwam3+gQLfHnUGPyVVswTj6qH49TDqPIEIwRrjKJR2sUSU4Tc6CQ2 p+/5tZ32F2QzBe14SFddcP/TCf4EveUw== From: Weiguo Li To: dev@dpdk.org Cc: adypodoman@gmail.com, xiaoyun.li@intel.com, tianfei.zhang@intel.com, bruce.richardson@intel.com, ivan.malov@oktetlabs.ru, jgrajcia@cisco.com, hkalra@marvell.com, ying.a.wang@intel.com, ting.xu@intel.com, simei.su@intel.com, qiming.yang@intel.com, motih@mellanox.com, shreyansh.jain@nxp.com, skoteshwar@marvell.com, stephen@networkplumber.org, kalesh-anakkur.purayil@broadcom.com, somnath.kotur@broadcom.com, declan.doherty@intel.com, gakhil@marvell.com, nicolas.chautru@intel.com Subject: [PATCH 11/20] net/iavf: fix a memory leak in error handling Date: Wed, 23 Feb 2022 02:18:09 +0800 X-OQ-MSGID: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org When function return from this branch, memory for 'items' is not freed which caused a memory leak. Fixes: ff2d0c345c3b ("net/iavf: support generic flow API") Signed-off-by: Weiguo Li --- drivers/net/iavf/iavf_generic_flow.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/iavf/iavf_generic_flow.c b/drivers/net/iavf/iavf_generic_flow.c index 2befa125ac..a733ebc613 100644 --- a/drivers/net/iavf/iavf_generic_flow.c +++ b/drivers/net/iavf/iavf_generic_flow.c @@ -2013,6 +2013,7 @@ iavf_search_pattern_match_item(const struct rte_flow_item pattern[], pattern_match_item = rte_zmalloc("iavf_pattern_match_item", sizeof(struct iavf_pattern_match_item), 0); if (!pattern_match_item) { + rte_free(items); rte_flow_error_set(error, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE, NULL, "Failed to allocate memory."); return NULL; -- 2.25.1