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 6C5A143185 for ; Tue, 17 Oct 2023 04:47:02 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 66D4C402B3; Tue, 17 Oct 2023 04:47:02 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 8CFBA4021D; Tue, 17 Oct 2023 04:47:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697510820; x=1729046820; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=w7usTJY3+QNpDi1jqs+IsJr3y3CKFEaZwDZzusPw/Bk=; b=TQvu+uDS//tcRXjJxte0TXGYa3KBpXqIWNnk4LvI6Ho/p7CyoAArqB+v EgxNd2GnIQ+v0/wFu+TbJmGNreIGbMORlnXgvmsJd/1R9ZE/ZU0ND6mXT pIWwuP2Wiiuzv4hwPkYyQL7nR99N2/qZdUxLpLWkm4qbRR035BYS9FULq adm17pFSWyCSDef5smfNA/brNNplccMpqotL0LJspqDCjtx3TceDttZ5n TNeTjoZ6q5N+K6d493WfNZSRpZiFkE3x7vEe5ijzjgJP9KTaJ+wsC+IfP Nx6TbMRdyU4BEC46Pp8ig70jaVy03hVe8xSSMhXt2udvLDndTsXwQguUD w==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="449909934" X-IronPort-AV: E=Sophos;i="6.03,230,1694761200"; d="scan'208";a="449909934" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 19:46:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,230,1694761200"; d="scan'208";a="3742331" Received: from dpdk-beileix-icelake.sh.intel.com ([10.67.116.231]) by orviesa001.jf.intel.com with ESMTP; 16 Oct 2023 19:45:53 -0700 From: beilei.xing@intel.com To: jingjing.wu@intel.com Cc: dev@dpdk.org, Beilei Xing , stable@dpdk.org Subject: [PATCH] net/cpfl: fix memory leak Date: Tue, 17 Oct 2023 11:06:55 +0000 Message-Id: <20231017110655.582873-1-beilei.xing@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Beilei Xing Fix resource leak reported in coverity scan. Coverity issue: 403265 Fixes: 2d823ecd671c ("net/cpfl: support device initialization") Fixes: 989465ac51ea ("net/cpfl: support probe again") Cc: stable@dpdk.org Signed-off-by: Beilei Xing --- drivers/net/cpfl/cpfl_ethdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c index 890a027a1d..0093deab5a 100644 --- a/drivers/net/cpfl/cpfl_ethdev.c +++ b/drivers/net/cpfl/cpfl_ethdev.c @@ -1626,7 +1626,8 @@ cpfl_parse_devargs(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *adap if (rte_kvargs_count(kvlist, CPFL_VPORT) > 1) { PMD_INIT_LOG(ERR, "devarg vport is duplicated."); - return -EINVAL; + ret = -EINVAL; + goto fail; } ret = rte_kvargs_process(kvlist, CPFL_REPRESENTOR, &parse_repr, cpfl_args); @@ -1635,7 +1636,7 @@ cpfl_parse_devargs(struct rte_pci_device *pci_dev, struct cpfl_adapter_ext *adap goto fail; if (!first) - return 0; + goto fail; ret = rte_kvargs_process(kvlist, CPFL_VPORT, &parse_vport, cpfl_args); -- 2.34.1