vhost-blk: delete the unused return value
PATCH 1/1 vhost-blk: delete the unused return value
Coverity issue: 350592
--- examples/vhost_blk/vhost_blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
examples/vhost_blk/vhost_blk.c +1 -1
@@ -852,7 +852,7 @@ new_device(int vid)if (ctrlr->packed_ring) {/* for the reconnection */ - ret =rte_vhost_get_vring_base_from_inflight ( +rte_vhost_get_vring_base_from_inflight ( ctrlr->bdev->vid, i, &blk_vq->last_avail_idx, &blk_vq->last_used_idx);
Signature · 1 line
2.17.2
Quoted 15 lines · Jin Yu
Coverity issue: 350592
Fixes c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")Signed-off-by Jin Yu <[email protected]>--- examples/vhost_blk/vhost_blk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)examples/vhost_blk/vhost_blk.c +0
-0
examples/vhost_blk/vhost_blk.c new_device(int vid) · line 858
Quoted 8 lines
examples/vhost_blk/vhost_blk.c +1
-1@@ -852,7 +852,7 @@ new_device(int vid)if (ctrlr->packed_ring) {/* for the reconnection */ - ret =rte_vhost_get_vring_base_from_inflight ( +rte_vhost_get_vring_base_from_inflight ( ctrlr->bdev->vid, i, &blk_vq->last_avail_idx, &blk_vq->last_used_idx);
It may be safer to handle the error, isn't it?
Maxime
PATCH v2 1/1 vhost-blk: fix the unused return value
In reply to Jin Yuadd the assert to handle error.
Coverity issue: 350592
---
v2 - add the error hander
--- examples/vhost_blk/vhost_blk.c | 1 + 1 file changed, 1 insertion(+)
examples/vhost_blk/vhost_blk.c +1 -0
@@ -856,6 +856,7 @@ new_device(int vid) ctrlr->bdev->vid, i, &blk_vq->last_avail_idx, &blk_vq->last_used_idx); +assert (ret ==0 ); blk_vq->avail_wrap_counter = blk_vq->last_avail_idx & (1 <<15 );
Signature · 1 line
2.17.2
Re: [dpdk-dev] [PATCH v2] vhost-blk: fix the unused return value
Quoted 19 lines · Jin Yu
add the assert to handle error.
Coverity issue: 350592
Fixes c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")Signed-off-by Jin Yu <[email protected]>---
v2 - add the error hander--- examples/vhost_blk/vhost_blk.c | 1 + 1 file changed, 1 insertion(+)examples/vhost_blk/vhost_blk.c +0
-0
examples/vhost_blk/vhost_blk.c new_device(int vid) · line 862
Quoted 7 lines
examples/vhost_blk/vhost_blk.c +1
-0@@ -856,6 +856,7 @@ new_device(int vid) ctrlr->bdev->vid, i, &blk_vq->last_avail_idx, &blk_vq->last_used_idx); +assert (ret ==0 ); blk_vq->avail_wrap_counter = blk_vq->last_avail_idx & (1 <<15 );
Thanks,
Maxime
Maxime Coquelin
AppliedRe: [dpdk-dev] [PATCH v2] vhost-blk: fix the unused return value
Quoted 26 lines · Maxime Coquelin
Quoted 23 lines · Jin Yu
add the assert to handle error.
Coverity issue: 350592
Fixes c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")Signed-off-by Jin Yu <[email protected]>---
v2 - add the error hander--- examples/vhost_blk/vhost_blk.c | 1 + 1 file changed, 1 insertion(+)examples/vhost_blk/vhost_blk.c +1
-0@@ -856,6 +856,7 @@ new_device(int vid) ctrlr->bdev->vid, i, &blk_vq->last_avail_idx, &blk_vq->last_used_idx); +assert (ret ==0 );
Quoted 9 lines
examples/vhost_blk/vhost_blk.c new_device(int vid) · line 862
Quoted 3 lines
examples/vhost_blk/vhost_blk.c +0
-0blk_vq->avail_wrap_counter = blk_vq->last_avail_idx & (1 <<15 );Reviewed-by Maxime Coquelin <[email protected]>Thanks,
Maxime
Applied to dpdk-next-virtio/master.
Thanks,
Maxime