[v2] vhost-blk: fix the unused return value

Message ID 20191127121659.51709-1-jin.yu@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Maxime Coquelin
Headers
Series [v2] vhost-blk: fix the unused return value |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed

Commit Message

Jin Yu Nov. 27, 2019, 12:16 p.m. UTC
  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

Maxime Coquelin Nov. 27, 2019, 12:57 p.m. UTC | #1
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
  
Maxime Coquelin Jan. 9, 2020, 3:51 p.m. UTC | #2
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
  

Patch

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);