examples/vhost_blk: check unused value on init
authorJin Yu <jin.yu@intel.com>
Wed, 27 Nov 2019 12:16:58 +0000 (20:16 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 17 Jan 2020 18:46:01 +0000 (19:46 +0100)
Add the assert to handle error.

Coverity issue: 350592
Fixes: c19beb3f38cd ("examples/vhost_blk: introduce vhost storage sample")
Cc: stable@dpdk.org
Signed-off-by: Jin Yu <jin.yu@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
examples/vhost_blk/vhost_blk.c

index 3182a48..e1036bf 100644 (file)
@@ -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);