DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] common/dpaax: fix incorrect error case
@ 2018-10-24  5:44 Shreyansh Jain
  2018-10-24 22:42 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Shreyansh Jain @ 2018-10-24  5:44 UTC (permalink / raw)
  To: dev; +Cc: thomas, Shreyansh Jain

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 <shreyansh.jain@nxp.com>
---
 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)
 	}
 
 	nodes = read_memory_node(&node_count);
-	if (nodes == NULL || node_count <= 0) {
+	if (nodes == NULL) {
 		DPAAX_WARN("PA->VA translation not available;");
 		DPAAX_WARN("Expect performance impact.");
 		return -1;
-- 
2.17.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] common/dpaax: fix incorrect error case
  2018-10-24  5:44 [dpdk-dev] [PATCH] common/dpaax: fix incorrect error case Shreyansh Jain
@ 2018-10-24 22:42 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2018-10-24 22:42 UTC (permalink / raw)
  To: Shreyansh Jain; +Cc: dev

24/10/2018 07:44, Shreyansh Jain:
> 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 <shreyansh.jain@nxp.com>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-24 22:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-24  5:44 [dpdk-dev] [PATCH] common/dpaax: fix incorrect error case Shreyansh Jain
2018-10-24 22:42 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).