From: Cheng Jiang Date: Wed, 12 May 2021 02:30:41 +0000 (+0000) Subject: vhost: fix sign extension in async split ring X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=11a7cd8c92deab38336099f7dc1ec2aaa455ae88;p=dpdk.git vhost: fix sign extension in async split ring Change the variable type in store_dma_desc_info_split() to fix suspicious implicit sign extension. Coverity issue: 370604, 370607, 370609 Fixes: 3d6cb86b0de5 ("vhost: refactor async split ring functions") Signed-off-by: Cheng Jiang --- diff --git a/lib/vhost/virtio_net.c b/lib/vhost/virtio_net.c index 8e36f4c340..9137a9923b 100644 --- a/lib/vhost/virtio_net.c +++ b/lib/vhost/virtio_net.c @@ -1474,7 +1474,7 @@ static __rte_always_inline void store_dma_desc_info_split(struct vring_used_elem *s_ring, struct vring_used_elem *d_ring, uint16_t ring_size, uint16_t s_idx, uint16_t d_idx, uint16_t count) { - uint16_t elem_size = sizeof(struct vring_used_elem); + size_t elem_size = sizeof(struct vring_used_elem); if (d_idx + count <= ring_size) { rte_memcpy(d_ring + d_idx, s_ring + s_idx, count * elem_size);