From patchwork Tue Sep 27 04:42:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Suresh Narayane, Harshad" X-Patchwork-Id: 116963 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BBD3CA00C2; Tue, 27 Sep 2022 10:34:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B132D41145; Tue, 27 Sep 2022 10:34:22 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id E3A4E41143 for ; Tue, 27 Sep 2022 10:34:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664267662; x=1695803662; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=46XpkYeP7AKb6bWmT3Z+mDDnxdc/Iq3PlmkFWFNJSFU=; b=WlzJu56QxUhhN/gSVGevP6FEuPwvPr9cCNLJQ1CmJ29kmRTi5H46JK4j S0dnMhCJ5sZ8I13YdtdT9Ssuz6OKc0ojEbAM/BQioYvyhzckQQoxY7B01 cAPCgGt59h0KhL4iY3c5jhm0r7kQ/NOEpBWXFgqRx9z+bCWHFFaOmqtea j0vAxmbM2/vj8YwfiEw9ifUJ/rNWPjnbmwHCu7gwmaIgDbbY9S5nTlwdz 3nD66Cb3KZN0DhrslmKkp07zK7Rkwloo7pDq0n4GUo0njHh63Ms/kA0h+ Qu9Dkkz77QYkvvr2AuLK1Id1EwN0GjR80uioD0vzZOn5o+z+6LuWGf6jd Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="298855720" X-IronPort-AV: E=Sophos;i="5.93,348,1654585200"; d="scan'208";a="298855720" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Sep 2022 01:34:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="725426057" X-IronPort-AV: E=Sophos;i="5.93,348,1654585200"; d="scan'208";a="725426057" Received: from ena-1.iind.intel.com (HELO localhost.localdomain) ([10.190.200.207]) by fmsmga002.fm.intel.com with ESMTP; 27 Sep 2022 01:34:16 -0700 From: Harshad Narayane To: dev@dpdk.org Cc: Kamalakannan R , Cristian Dumitrescu Subject: [PATCH] net/softnic: fix memory free Date: Tue, 27 Sep 2022 00:42:30 -0400 Message-Id: <20220927044230.367148-1-harshad.suresh.narayane@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 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 Coverity issue: 380975 Coverity issue: 380977 Fixes: 02270033 ("net/softnic: add pipeline library build command") Fix memory resource free for buffer allocation failure at pipeline library build. Signed-off-by: Harshad Narayane Signed-off-by: Kamalakannan R Acked-by: Cristian Dumitrescu --- drivers/net/softnic/rte_eth_softnic_cli.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/softnic/rte_eth_softnic_cli.c b/drivers/net/softnic/rte_eth_softnic_cli.c index e46383352b..085523fe03 100644 --- a/drivers/net/softnic/rte_eth_softnic_cli.c +++ b/drivers/net/softnic/rte_eth_softnic_cli.c @@ -327,7 +327,7 @@ cmd_softnic_pipeline_libbuild(struct pmd_internals *softnic __rte_unused, buffer = malloc(MAX_LINE_SIZE); if (!buffer) { snprintf(out, out_size, MSG_OUT_OF_MEMORY); - return; + goto free; } snprintf(buffer,