All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: "thomas@monjalon.net" <thomas@monjalon.net>,
	Shreyansh Jain <shreyansh.jain@nxp.com>
Subject: [PATCH] common/dpaax: fix incorrect error case
Date: Wed, 24 Oct 2018 05:44:09 +0000	[thread overview]
Message-ID: <20181024054334.23732-1-shreyansh.jain@nxp.com> (raw)

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

             reply	other threads:[~2018-10-24  5:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-24  5:44 Shreyansh Jain [this message]
2018-10-24 22:42 ` [PATCH] common/dpaax: fix incorrect error case Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181024054334.23732-1-shreyansh.jain@nxp.com \
    --to=shreyansh.jain@nxp.com \
    --cc=dev@dpdk.org \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.