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 74D35A054F; Tue, 16 Mar 2021 05:33:10 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F02074069F; Tue, 16 Mar 2021 05:33:09 +0100 (CET) Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.232.172]) by mails.dpdk.org (Postfix) with ESMTP id 4082E40042 for ; Tue, 16 Mar 2021 05:33:08 +0100 (CET) Received: from dhcp-10-123-153-22.dhcp.broadcom.net (bgccx-dev-host-lnx2.bec.broadcom.net [10.123.153.22]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 8EAC17DAE; Mon, 15 Mar 2021 21:33:06 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 8EAC17DAE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1615869187; bh=m3+zXv9QKfCodpOTL7R38kWDw2UneAhAhxXeCkU5Sx0=; h=From:To:Cc:Subject:Date:From; b=W2eZisT/ijsLB0e4YpJVdm+8g8UySsvV61lzU8yjxQfPb3H01JgTER+TBVvhJj/jb HXWn72injItByH/eNyNGlmH7jmHMgWlmfBv9Jvt24Tan9Lgz9LOKFLqy76at4xR/m8 4xDXy7e30U0tkKX+BPnL2KpoZN9RvGv4/YYPj2P4= From: Kalesh A P To: dev@dpdk.org Cc: xiaoyun.li@intel.com, ferruh.yigit@intel.com Date: Tue, 16 Mar 2021 10:25:18 +0530 Message-Id: <20210316045518.20234-1-kalesh-anakkur.purayil@broadcom.com> X-Mailer: git-send-email 2.10.1 Subject: [dpdk-dev] [PATCH] app/testpmd: fix unchecked return value 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 Sender: "dev" From: Kalesh AP CID 353629 (#1 of 1): Unchecked return value (CHECKED_RETURN) check_return: Calling rte_eth_dev_info_get without checking return value (as is done elsewhere 110 out of 117 times). Coverity issue: 353629 Fixes: e1d44d0ad623 ("app/testpmd: show MAC addresses added to a port") Cc: stable@dpdk.org Signed-off-by: Kalesh AP --- app/test-pmd/config.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 576d5ac..ade26e0 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -4927,10 +4927,15 @@ show_macs(portid_t port_id) struct rte_ether_addr *addr; uint32_t i, num_macs = 0; struct rte_eth_dev *dev; + int ret; dev = &rte_eth_devices[port_id]; - rte_eth_dev_info_get(port_id, &dev_info); + ret = rte_eth_dev_info_get(port_id, &dev_info); + if (ret != 0) { + printf("rte_eth_dev_info_get() failed for port %u\n", port_id); + return; + } for (i = 0; i < dev_info.max_mac_addrs; i++) { addr = &dev->data->mac_addrs[i]; -- 2.10.1