Skip to contentSkip to conversation

vhost/crypto: fix coverity issues

PATCH Applied Fan Zhang 2 participants 3 messages Mar 25, 2019 – Mar 27, 2019

lore
Share & tools
lore

Fan Zhang

author
#0 lore raw

PATCH 1/1 vhost/crypto: fix coverity issues

Fixes cd1e8f03abf0 ("vhost/crypto: fix packet copy in chaining mode")

Coverity Issue: 277214
Coverity Issue: 277220
Coverity Issue: 277233
Coverity Issue: 277236

---
 lib/librte_vhost/vhost_crypto.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_vhost/vhost_crypto.c +2 -2
index 9b4b850e8..0edf12d52 100644
@@ -1109,7 +1109,7 @@ prepare_sym_chain_op(struct vhost_crypto *vcrypto, struct rte_crypto_op *op,
 
 		if (unlikely(copy_data(digest_addr, vc_req, &digest_desc,
 				chain->para.hash_result_len,
-				nb_descs, vq_size)) < 0) {
+				nb_descs, vq_size) < 0)) {
 			ret = VIRTIO_CRYPTO_BADMSG;
 			goto error_exit;
 		}
@@ -1627,7 +1627,7 @@ rte_vhost_crypto_fetch_requests(int vid, uint32_t qid,
 			op->sym->m_src->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
Reviewed-by on v1 1/1
#1 lore raw
Quoted 29 lines · Fan Zhang
Fixes cd1e8f03abf0 ("vhost/crypto: fix packet copy in chaining mode")

Coverity Issue: 277214
Coverity Issue: 277220
Coverity Issue: 277233
Coverity Issue: 277236

---
  lib/librte_vhost/vhost_crypto.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
lib/librte_vhost/vhost_crypto.c +1 -1
index 9b4b850e8..0edf12d52 100644
@@ -1109,7 +1109,7 @@ prepare_sym_chain_op(struct vhost_crypto *vcrypto, struct rte_crypto_op *op,
 
  		if (unlikely(copy_data(digest_addr, vc_req, &digest_desc,
  				chain->para.hash_result_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 1633

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

Good catch from Coverity!

Thanks,
Maxime

#2 lore raw
In reply to Fan Zhang
Quoted 7 lines · Fan Zhang
Fixes cd1e8f03abf0 ("vhost/crypto: fix packet copy in chaining mode")

Coverity Issue: 277214
Coverity Issue: 277220
Coverity Issue: 277233
Coverity Issue: 277236

Quoted 7 lines
---
  lib/librte_vhost/vhost_crypto.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to dpdk-next-virtio/master.

Thanks,
Maxime