From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30049.outbound.protection.outlook.com [40.107.3.49]) by dpdk.org (Postfix) with ESMTP id 459774C9F for ; Wed, 24 Oct 2018 07:44:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WdGoG+LtMR3qPqtJrJXWsIlzp/PhidVKmKtvbl7YfLI=; b=JFj0p14bLY5+l0iaF1gT+aT2wr4DhnnN3qSa6ycs2dmVy6/ujbqV4BOQ8K9gWRXgmQxraVID/5/TjSZJGig0sLujp8yrZ0Fpu2grkH1sXSvAOkAAGqWlg474afngSEYq5BwUbn9gtqlsxPEvxuAmpHglPyiGc/AA6AwuNN3jdaU= Received: from VI1PR04MB4688.eurprd04.prod.outlook.com (20.177.56.80) by VI1PR04MB5071.eurprd04.prod.outlook.com (20.177.50.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.30; Wed, 24 Oct 2018 05:44:10 +0000 Received: from VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::88ff:b776:3f9c:5bb2]) by VI1PR04MB4688.eurprd04.prod.outlook.com ([fe80::88ff:b776:3f9c:5bb2%2]) with mapi id 15.20.1250.028; Wed, 24 Oct 2018 05:44:10 +0000 From: Shreyansh Jain To: "dev@dpdk.org" CC: "thomas@monjalon.net" , Shreyansh Jain Thread-Topic: [PATCH] common/dpaax: fix incorrect error case Thread-Index: AQHUa1yWsMsCzcbZlU6KyseXrXHmGg== Date: Wed, 24 Oct 2018 05:44:09 +0000 Message-ID: <20181024054334.23732-1-shreyansh.jain@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.142.187.166] x-mailer: git-send-email 2.17.1 x-clientproxiedby: BMXPR01CA0018.INDPRD01.PROD.OUTLOOK.COM (2603:1096:b00:d::28) To VI1PR04MB4688.eurprd04.prod.outlook.com (2603:10a6:803:71::16) authentication-results: spf=none (sender IP is ) smtp.mailfrom=shreyansh.jain@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; VI1PR04MB5071; 6:I+l0ZeaeSItwfNL5sw7gIF5A6mfUgbKNjQCY1OYGa6x19CeQ+2+891qpukutkNURod/bObU80XpiN3oiIUFiatu1thimOptyMSupH6U6rk/axubZlYTGYHwIKbFR2YviDk3MIufAVS9ksqZ0hMAW0PMjWK3CPLwcW9DXSjyHuxsDxo3dR7mUsXAtfXHDpaHU4Y4hzdbWAFnQ4xb1duuCTbNtIjnxi4NwG+fVPPk0U2GsCHaanpnm67CAfs4sz9zdQid12Q+rV/38JlGgmEgBEDVuIZw4hxuvtJgflpw4co1FJhBPTdZQaSOuTbJ4wLANHhyG2jKG3MO8Qz1fdLkk6QrcjIyFSIsXGWDwiV0yMLQWgTAqqZv4DCep1rtg6tKe6wExHclgrViU21Cq2EFryQYV++nFd89t7KGpF/GzwdsR20jmcdBNoexZOLbN+BYqZMF7Asolikplp5ZrgMxsrA==; 5:Vtkw+K7Qq/nzZ84eMG9bWfF68gJcsDdSLB5AnTOgtMXRHcXp4mshstYDGtUn/jt6t9D+o8vZ5TQtOZ7hftV0dehYQFIdUvCyDialBVoZYLARhiPZW5mklsIMc5lNVHj/THTPf2flyUXwdNU9FT16a0zCwW63wx+llE1lhprfDb4=; 7:qXUs0c8wmDmiSeU3OqnJhQKsvgEiE5L9Srqgj+FsLnEd7bv+8fg1KGmINdH8C8aDFXsnAKjvHtcWzc3skfX90iKzhp2cMEwCazP7FYSrOB2pfwX/HgzV/TFPhwsZ33oQm/vUPUUqya4lpnSnW4TfYR92ej4rR6+Kra4pnFxpLKr1VxzrDt57h25BdJRKsl17+xV8LR0h8qwGumLqwHdvtbVLwcWQAsEIN7LHmh3p0q7e5SY3GImKBr7sDdhfBO6t x-ms-office365-filtering-correlation-id: c3c17504-06b0-4541-fbae-08d63973b840 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:VI1PR04MB5071; x-ms-traffictypediagnostic: VI1PR04MB5071: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(185117386973197); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231355)(944501410)(52105095)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:VI1PR04MB5071; BCL:0; PCL:0; RULEID:; SRVR:VI1PR04MB5071; x-forefront-prvs: 083526BF8A x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(136003)(366004)(346002)(376002)(189003)(199004)(256004)(105586002)(486006)(78486010)(14444005)(316002)(8936002)(71190400001)(2906002)(71200400001)(2501003)(25786009)(66066001)(6436002)(305945005)(478600001)(7736002)(86362001)(4326008)(6512007)(97736004)(2351001)(6916009)(6506007)(3846002)(6116002)(26005)(6486002)(1076002)(5640700003)(476003)(1857600001)(5250100002)(53936002)(55236004)(106356001)(5660300001)(14454004)(36756003)(54906003)(99286004)(2616005)(8676002)(386003)(186003)(1730700003)(81166006)(102836004)(81156014)(52116002)(2900100001)(50226002)(68736007)(44832011); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR04MB5071; H:VI1PR04MB4688.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: xBloD1FwsRGv53sc+f8iV/WhibwC8LtX/0uCjeUI9TSlVokyly4MzQ5eTtqxkUNiOPctATR9Jq7gnjh+O4ZydBiIKc6ELz5t2t1sF/K66kWLUjB4OPETYVGOw3hw+wIPYjcucejof0FUdoWnJAMdH/3wSV/NAt4l0bNwe/28LoP2yvoeD0DtGNsnVLyDXvoUdNUnjVGj8gMx8UR6S7X53fLHhQJhXoKzmMmpjEnM8uo3Iq1BL3Zp+zijX57kA9V9tnZzFipuPMRARlm2mroYiELysGn8LSSp3YVIJI8aKtFhytqMWMb1kIlsgffKghfGScZ5KIXYakn2BgOdGBgRYiDkgWrpNrXK2uh5kku6rXw= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3c17504-06b0-4541-fbae-08d63973b840 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Oct 2018 05:44:09.9948 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR04MB5071 Subject: [dpdk-dev] [PATCH] common/dpaax: fix incorrect error case 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: , X-List-Received-Date: Wed, 24 Oct 2018 05:44:11 -0000 In case the memory for nodes cannot be allocated, there is no need to check for the length. Also, `node_count` is an unsigned value and cannot be less than 0. Coverity issue: 323521 Fixes: 2f3d633aa593 ("common/dpaax: add library for PA/VA translation table= ") Cc: shreyansh.jain@nxp.com Signed-off-by: Shreyansh Jain --- drivers/common/dpaax/dpaax_iova_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/common/dpaax/dpaax_iova_table.c b/drivers/common/dpaax= /dpaax_iova_table.c index d54267bb7..19a4e8c58 100644 --- a/drivers/common/dpaax/dpaax_iova_table.c +++ b/drivers/common/dpaax/dpaax_iova_table.c @@ -172,7 +172,7 @@ dpaax_iova_table_populate(void) } =20 nodes =3D read_memory_node(&node_count); - if (nodes =3D=3D NULL || node_count <=3D 0) { + if (nodes =3D=3D NULL) { DPAAX_WARN("PA->VA translation not available;"); DPAAX_WARN("Expect performance impact."); return -1; --=20 2.17.1