[v2] vhost-blk: fix the unused return value
Checks
Commit Message
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>
---
v2 - add the error hander
---
examples/vhost_blk/vhost_blk.c | 1 +
1 file changed, 1 insertion(+)
Comments
On 11/27/19 1:16 PM, Jin Yu wrote:
> 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>
> ---
> v2 - add the error hander
> ---
> examples/vhost_blk/vhost_blk.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c
> index 3182a488b..e1036bf3a 100644
> --- a/examples/vhost_blk/vhost_blk.c
> +++ b/examples/vhost_blk/vhost_blk.c
> @@ -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);
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
On 11/27/19 1:57 PM, Maxime Coquelin wrote:
>
>
> On 11/27/19 1:16 PM, Jin Yu wrote:
>> 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>
>> ---
>> v2 - add the error hander
>> ---
>> examples/vhost_blk/vhost_blk.c | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/examples/vhost_blk/vhost_blk.c b/examples/vhost_blk/vhost_blk.c
>> index 3182a488b..e1036bf3a 100644
>> --- a/examples/vhost_blk/vhost_blk.c
>> +++ b/examples/vhost_blk/vhost_blk.c
>> @@ -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);
>>
>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>
> Thanks,
> Maxime
>
Applied to dpdk-next-virtio/master.
Thanks,
Maxime
@@ -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);