[v1] net/virtio-user: fix uninitialized variable
diff mbox series

Message ID 20200714110305.73911-1-chenbo.xia@intel.com
State Accepted
Delegated to: Maxime Coquelin
Headers show
Series
  • [v1] net/virtio-user: fix uninitialized variable
Related show

Checks

Context Check Description
ci/iol-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Chenbo Xia July 14, 2020, 11:03 a.m. UTC
This patch fixes an issue that uninitialized has_reply_ack
is used for setting message flags.

Coverity issue: 360834
Fixes: c60208dd6384 ("net/virtio-user: support reply-ack")

Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
---
 drivers/net/virtio/virtio_user/vhost_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Adrian Moreno July 15, 2020, 6:32 a.m. UTC | #1
On 7/14/20 1:03 PM, Chenbo Xia wrote:
> This patch fixes an issue that uninitialized has_reply_ack
> is used for setting message flags.
> 
> Coverity issue: 360834
> Fixes: c60208dd6384 ("net/virtio-user: support reply-ack")
> 
> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
> ---
>  drivers/net/virtio/virtio_user/vhost_user.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
> index 631d0e353..ad48bafd4 100644
> --- a/drivers/net/virtio/virtio_user/vhost_user.c
> +++ b/drivers/net/virtio/virtio_user/vhost_user.c
> @@ -254,7 +254,7 @@ vhost_user_sock(struct virtio_user_dev *dev,
>  	struct vhost_user_msg msg;
>  	struct vhost_vring_file *file = 0;
>  	int need_reply = 0;
> -	int has_reply_ack;
> +	int has_reply_ack = 0;
>  	int fds[VHOST_MEMORY_MAX_NREGIONS];
>  	int fd_num = 0;
>  	int len;
> 

Acked-by: Adrián Moreno <amorenoz@redhat.com>
Ferruh Yigit July 16, 2020, 4:14 p.m. UTC | #2
On 7/15/2020 7:32 AM, Adrian Moreno wrote:
> 
> On 7/14/20 1:03 PM, Chenbo Xia wrote:
>> This patch fixes an issue that uninitialized has_reply_ack
>> is used for setting message flags.
>>
>> Coverity issue: 360834
>> Fixes: c60208dd6384 ("net/virtio-user: support reply-ack")
>>
>> Signed-off-by: Chenbo Xia <chenbo.xia@intel.com>
>> ---
>>  drivers/net/virtio/virtio_user/vhost_user.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
>> index 631d0e353..ad48bafd4 100644
>> --- a/drivers/net/virtio/virtio_user/vhost_user.c
>> +++ b/drivers/net/virtio/virtio_user/vhost_user.c
>> @@ -254,7 +254,7 @@ vhost_user_sock(struct virtio_user_dev *dev,
>>  	struct vhost_user_msg msg;
>>  	struct vhost_vring_file *file = 0;
>>  	int need_reply = 0;
>> -	int has_reply_ack;
>> +	int has_reply_ack = 0;
>>  	int fds[VHOST_MEMORY_MAX_NREGIONS];
>>  	int fd_num = 0;
>>  	int len;
>>
> 
> Acked-by: Adrián Moreno <amorenoz@redhat.com>
> 

Applied to dpdk-next-net/master, thanks.

Patch
diff mbox series

diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index 631d0e353..ad48bafd4 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -254,7 +254,7 @@  vhost_user_sock(struct virtio_user_dev *dev,
 	struct vhost_user_msg msg;
 	struct vhost_vring_file *file = 0;
 	int need_reply = 0;
-	int has_reply_ack;
+	int has_reply_ack = 0;
 	int fds[VHOST_MEMORY_MAX_NREGIONS];
 	int fd_num = 0;
 	int len;