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 267C3A00C5; Wed, 13 May 2020 22:22:30 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E50F61D5FF; Wed, 13 May 2020 22:22:29 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 7AA7C1D5F6 for ; Wed, 13 May 2020 22:22:28 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 04DKG2Zb007899 for ; Wed, 13 May 2020 13:22:27 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0818; bh=eqEQ/Cl+CA3wfLJlzwglKEwAyrToMRl39fWuFrvC8Qw=; b=ieBOkFFlMS5pnGf1jeYtWs43Rtztg3RT1JQL0edVarCCcGIc9RBVcAlXlSvEBPdFEcdG Us7ML1Fxk6HY49NlYS0NMgjnnfCjIUtbMgmKbxSo6ZaEb39wFrZKvXAl5zXLOqHKb3wN dMzXP0WdRY2gRriBmDxzGHNBeX5FD8qkRk1esjPC+uzyM1L5lH0ILG3p2Qxb0WaXMMPE qS4vha51eVlQgT2bprxcwggfM7aI3e4tYItlf2tV68wXfgAvFG68H6ehYOI4bq0Q+uiC y6/ZJAVe6i4YCWquczPedHb4XRdaZjY4gd/5ZYDclzb4i86h3rvNrxs7lHeOtsnAdi9S iA== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 3100xjxjvg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Wed, 13 May 2020 13:22:27 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 13 May 2020 13:22:25 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 13 May 2020 13:22:25 -0700 Received: from BG-LT7430.marvell.com (BG-LT7430.marvell.com [10.28.161.240]) by maili.marvell.com (Postfix) with ESMTP id C06F83F703F; Wed, 13 May 2020 13:22:23 -0700 (PDT) From: To: , Kiran Kumar K , "Nithin Dabilpuram" CC: , Pavan Nikhilesh Date: Thu, 14 May 2020 01:52:17 +0530 Message-ID: <20200513202218.6045-1-pbhagavatula@marvell.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.216, 18.0.676 definitions=2020-05-13_09:2020-05-13, 2020-05-13 signatures=0 Subject: [dpdk-dev] [PATCH] examples/l3fwd-graph: fix unchecked function return values 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: Pavan Nikhilesh Fix unchecked return values reported by coverity. Coverity issue: 350601 Fixes: ef853f1fd979 ("examples/l3fwd-graph: add ethdev configuration changes") Signed-off-by: Pavan Nikhilesh --- examples/l3fwd-graph/main.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c index 40108a0d3..c70270c4d 100644 --- a/examples/l3fwd-graph/main.c +++ b/examples/l3fwd-graph/main.c @@ -598,6 +598,7 @@ check_all_ports_link_status(uint32_t port_mask) uint8_t count, all_ports_up, print_flag = 0; struct rte_eth_link link; uint16_t portid; + int ret; printf("\nChecking link status"); fflush(stdout); @@ -612,7 +613,14 @@ check_all_ports_link_status(uint32_t port_mask) if ((port_mask & (1 << portid)) == 0) continue; memset(&link, 0, sizeof(link)); - rte_eth_link_get_nowait(portid, &link); + ret = rte_eth_link_get_nowait(portid, &link); + if (ret < 0) { + all_ports_up = 0; + if (print_flag == 1) + printf("Port %u link get failed: %s\n", + portid, rte_strerror(-ret)); + continue; + } /* Print link status if flag set */ if (print_flag == 1) { if (link.link_status) -- 2.17.1