DPDK patches and discussions
 help / color / mirror / Atom feed
From: Fan Zhang <roy.fan.zhang@intel.com>
To: dev@dpdk.org
Cc: maxime.coquelin@redhat.com, Fan Zhang <roy.fan.zhang@intel.com>,
	stable@dpdk.org
Subject: [dpdk-dev] [PATCH] vhost/crypto: fix incorrect fetch size
Date: Wed, 29 Jan 2020 10:24:22 +0000	[thread overview]
Message-ID: <20200129102422.57466-1-roy.fan.zhang@intel.com> (raw)
In-Reply-To: <20191126095410.72395-1-roy.fan.zhang@intel.com>

Coverity issue: 343401

This patch fixes the incorrect rte_vhost_crypto_fetch_requests
return value.

Fixes: 3bb595ecd682 ("vhost/crypto: add request handler")
Cc: roy.fan.zhang@intel.com
Cc: stable@dpdk.org

Signed-off-by: Fan Zhang <roy.fan.zhang@intel.com>
---
 lib/librte_vhost/vhost_crypto.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/librte_vhost/vhost_crypto.c b/lib/librte_vhost/vhost_crypto.c
index 684fddc30..68911972b 100644
--- a/lib/librte_vhost/vhost_crypto.c
+++ b/lib/librte_vhost/vhost_crypto.c
@@ -1539,18 +1539,18 @@ rte_vhost_crypto_fetch_requests(int vid, uint32_t qid,
 
 	if (unlikely(dev == NULL)) {
 		VC_LOG_ERR("Invalid vid %i", vid);
-		return -EINVAL;
+		return 0;
 	}
 
 	if (unlikely(qid >= VHOST_MAX_QUEUE_PAIRS)) {
 		VC_LOG_ERR("Invalid qid %u", qid);
-		return -EINVAL;
+		return 0;
 	}
 
 	vcrypto = (struct vhost_crypto *)dev->extern_data;
 	if (unlikely(vcrypto == NULL)) {
 		VC_LOG_ERR("Cannot find required data, is it initialized?");
-		return -ENOENT;
+		return 0;
 	}
 
 	vq = dev->virtqueue[qid];
@@ -1572,7 +1572,7 @@ rte_vhost_crypto_fetch_requests(int vid, uint32_t qid,
 		if (unlikely(rte_mempool_get_bulk(vcrypto->mbuf_pool,
 				(void **)mbufs, count * 2) < 0)) {
 			VC_LOG_ERR("Insufficient memory");
-			return -ENOMEM;
+			return 0;
 		}
 
 		for (i = 0; i < count; i++) {
@@ -1602,7 +1602,7 @@ rte_vhost_crypto_fetch_requests(int vid, uint32_t qid,
 		if (unlikely(rte_mempool_get_bulk(vcrypto->mbuf_pool,
 				(void **)mbufs, count) < 0)) {
 			VC_LOG_ERR("Insufficient memory");
-			return -ENOMEM;
+			return 0;
 		}
 
 		for (i = 0; i < count; i++) {
-- 
2.20.1


  parent reply	other threads:[~2020-01-29 10:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-26  9:54 [dpdk-dev] [PATCH] example/vhost_crypto: " Fan Zhang
2020-01-14  9:30 ` Maxime Coquelin
2020-01-29 10:21   ` Zhang, Roy Fan
2020-01-29 10:19 ` [dpdk-dev] [PATCH] vhost/crypto: fix missed user protocol flag Fan Zhang
2020-04-07 13:34   ` Maxime Coquelin
2020-04-10 14:42   ` Maxime Coquelin
2020-01-29 10:24 ` Fan Zhang [this message]
2020-02-05  9:20   ` [dpdk-dev] [PATCH] vhost/crypto: fix incorrect fetch size Maxime Coquelin
2020-02-05  9:48   ` Maxime Coquelin

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=20200129102422.57466-1-roy.fan.zhang@intel.com \
    --to=roy.fan.zhang@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=stable@dpdk.org \
    /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 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).