vhost: fix sign extension in async packed ring
Change the variable type in store_dma_desc_info_packed() to fix
suspicious implicit sign extension.
Coverity issue: 370608, 370610, 370612
Fixes: 873e8dad6f
("vhost: support packed ring in async datapath")
Signed-off-by: Cheng Jiang <cheng1.jiang@intel.com>
This commit is contained in:
parent
11a7cd8c92
commit
35139e648a
@ -1491,7 +1491,7 @@ store_dma_desc_info_packed(struct vring_used_elem_packed *s_ring,
|
||||
struct vring_used_elem_packed *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_packed);
|
||||
size_t elem_size = sizeof(struct vring_used_elem_packed);
|
||||
|
||||
if (d_idx + count <= ring_size) {
|
||||
rte_memcpy(d_ring + d_idx, s_ring + s_idx, count * elem_size);
|
||||
|
Loading…
Reference in New Issue
Block a user