From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 728D6A00C5; Thu, 7 May 2020 12:50:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 382811DC24; Thu, 7 May 2020 12:50:10 +0200 (CEST) Received: from relay.smtp.broadcom.com (relay.smtp.broadcom.com [192.19.211.62]) by dpdk.org (Postfix) with ESMTP id BE6D21DC03 for ; Thu, 7 May 2020 12:50:08 +0200 (CEST) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp.broadcom.com (Postfix) with ESMTP id 3B15529F8B1; Thu, 7 May 2020 03:50:07 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 relay.smtp.broadcom.com 3B15529F8B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1588848607; bh=LRYu00FnOPNFFiQVrIQN6Tod5l4mhPPjZ3/vDfGiyDY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ttSJK2Hphu8nSyShVRJQMo+hBT4MP3B02XriTWK6S79s/I1Wb+Z+XqpLiV+Yz/DaC LNtLc7+3OrcE//zABMiTukmK5PjTyi08tvx8BNghgkIDzEQ4OXfJCJjdik8ReX857k Uo16jssdT5hY6dLsJpnCzoIFzYZGCAytP9R6LdlA= From: Kalesh A P To: dev@dpdk.org Cc: ferruh.yigit@intel.com, beilei.xing@intel.com, jingjing.wu@intel.com, bernard.iremonger@intel.com Date: Thu, 7 May 2020 16:36:11 +0530 Message-Id: <20200507110611.30877-1-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 In-Reply-To: <20200507090827.27945-1-kalesh-anakkur.purayil@broadcom.com> References: <20200507090827.27945-1-kalesh-anakkur.purayil@broadcom.com> Subject: [dpdk-dev] [PATCH v2] app/testpmd: fix null pointer dereferencing issue X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kalesh AP Note that the issue was observed in an internal Coverity scan. Fixes: e088907bb851 ("app/testpmd: add command for getting loaded DDP profiles") Cc: stable@dpdk.org Signed-off-by: Kalesh AP --- v2: fixed headline case app/test-pmd/cmdline.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index b040630..996a498 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -16891,8 +16891,10 @@ cmd_ddp_get_list_parsed( #ifdef RTE_LIBRTE_I40E_PMD size = PROFILE_INFO_SIZE * MAX_PROFILE_NUM + 4; p_list = (struct rte_pmd_i40e_profile_list *)malloc(size); - if (!p_list) + if (!p_list) { printf("%s: Failed to malloc buffer\n", __func__); + return; + } if (ret == -ENOTSUP) ret = rte_pmd_i40e_get_ddp_list(res->port_id, -- 2.10.1