Skip to contentSkip to conversation

vhost/crypto: fix logically dead code

PATCH Applied Fan Zhang 3 participants 4 messages May 15, 2019 – Jun 20, 2019

lore
Share & tools
lore

Fan Zhang

author
#0 lore raw

PATCH 1/1 vhost/crypto: fix logically dead code

This patch fixes a few same class bugs that causes the logically dead code in vhost_crypto.

Coverity issue: 277236
Coverity issue: 277233
Coverity issue: 277220
Coverity issue: 277214

Fixes 3bb595ecd682 ("vhost/crypto: add request handler")
---
 lib/librte_vhost/vhost_crypto.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_vhost/vhost_crypto.c +2 -2
index 0edf12d52..069b56108 100644
@@ -1024,7 +1024,7 @@ prepare_sym_chain_op(struct vhost_crypto *vcrypto, struct rte_crypto_op *op,
 		}
 		if (unlikely(copy_data(rte_pktmbuf_mtod(m_src, uint8_t *),
 				vc_req, &desc, chain->para.src_data_len,
-				nb_descs, vq_size)) < 0) {
+				nb_descs, vq_size) < 0)) {
 			ret = VIRTIO_CRYPTO_BADMSG;
 			goto error_exit;
 		}
@@ -1598,7 +1598,7 @@ rte_vhost_crypto_fetch_requests(int vid, uint32_t qid,
 			op->sym->m_dst->data_off = 0;
 
 			if (unlikely(vhost_crypto_process_one_req(vcrypto, vq,
-					op, head, desc_idx)) < 0)
+					op, head, desc_idx) < 0))
 				break;
 		}
 
Signature · 1 line
2.14.5
Acked-by on v1 1/1
#1 lore raw
Quoted 41 lines

Subject: [dpdk-dev] [PATCH] vhost/crypto: fix logically dead code

This patch fixes a few same class bugs that causes the logically dead code in vhost_crypto.

Coverity issue: 277236
Coverity issue: 277233
Coverity issue: 277220
Coverity issue: 277214

Fixes 3bb595ecd682 ("vhost/crypto: add request handler")
---
 lib/librte_vhost/vhost_crypto.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_vhost/vhost_crypto.c +1 -1
index 0edf12d52..069b56108 100644
@@ -1024,7 +1024,7 @@ prepare_sym_chain_op(struct vhost_crypto
 *vcrypto, struct rte_crypto_op *op,
 		}
 		if (unlikely(copy_data(rte_pktmbuf_mtod(m_src, uint8_t *),
 				vc_req, &desc, chain->para.src_data_len,
-				nb_descs, vq_size)) < 0) {
+				nb_descs, vq_size) < 0)) {
 			ret = VIRTIO_CRYPTO_BADMSG;
 			goto error_exit;
lib/librte_vhost/vhost_crypto.c +1 -1
 		}
@@ -1598,7 +1598,7 @@ rte_vhost_crypto_fetch_requests(int vid, uint32_t
 qid,
 			op->sym->m_dst->data_off = 0;
 
 			if (unlikely(vhost_crypto_process_one_req(vcrypto,
 vq,
-					op, head, desc_idx)) < 0)
+					op, head, desc_idx) < 0))
 				break;
Quoted 1 line

}

Reviewed-by on v1 1/1
#2 lore raw
In reply to Fan Zhang
Quoted 31 lines · Fan Zhang

This patch fixes a few same class bugs that causes the logically dead code in vhost_crypto.

Coverity issue: 277236
Coverity issue: 277233
Coverity issue: 277220
Coverity issue: 277214

Fixes 3bb595ecd682 ("vhost/crypto: add request handler")
---
  lib/librte_vhost/vhost_crypto.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_vhost/vhost_crypto.c +1 -1
index 0edf12d52..069b56108 100644
@@ -1024,7 +1024,7 @@ prepare_sym_chain_op(struct vhost_crypto *vcrypto, struct rte_crypto_op *op,
  		}
  		if (unlikely(copy_data(rte_pktmbuf_mtod(m_src, uint8_t *),
  				vc_req, &desc, chain->para.src_data_len,
-				nb_descs, vq_size)) < 0) {
+				nb_descs, vq_size) < 0)) {
  			ret = VIRTIO_CRYPTO_BADMSG;
  			goto error_exit;
  		}

lib/librte_vhost/vhost_crypto.c rte_vhost_crypto_fetch_requests(int vid, uint32_t qid, · line 1604

Quoted 8 lines
lib/librte_vhost/vhost_crypto.c +1 -1
@@ -1598,7 +1598,7 @@ rte_vhost_crypto_fetch_requests(int vid, uint32_t qid,
  			op->sym->m_dst->data_off = 0;
 
  			if (unlikely(vhost_crypto_process_one_req(vcrypto, vq,
-					op, head, desc_idx)) < 0)
+					op, head, desc_idx) < 0))
  				break;
  		}
 

Thanks,
Maxime

#3 lore raw
In reply to Fan Zhang
Quoted 8 lines · Fan Zhang

This patch fixes a few same class bugs that causes the logically dead code in vhost_crypto.

Coverity issue: 277236
Coverity issue: 277233
Coverity issue: 277220
Coverity issue: 277214

Quoted 8 lines
Fixes 3bb595ecd682 ("vhost/crypto: add request handler")
---
  lib/librte_vhost/vhost_crypto.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to dpdk-next-virtio/master.

Thanks,
Maxime