lkml.org 
[lkml]   [2019]   [Mar]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] vhost/vsock: initialize vhost_vsock->hash
Date
There's no current valid use case when uninitialized hash can be read
before being written, however let's keep every vhost_vsock field
initialized just for clarity.

Signed-off-by: Vitaly Mayatskikh <v.mayatskih@gmail.com>
---
drivers/vhost/vsock.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c
index bb5fc0e..f43f4ed 100644
--- a/drivers/vhost/vsock.c
+++ b/drivers/vhost/vsock.c
@@ -537,6 +537,7 @@ static int vhost_vsock_dev_open(struct inode *inode, struct file *file)
spin_lock_init(&vsock->send_pkt_list_lock);
INIT_LIST_HEAD(&vsock->send_pkt_list);
vhost_work_init(&vsock->send_pkt_work, vhost_transport_send_pkt_work);
+ INIT_HLIST_NODE(&vsock->hash);
return 0;

out:
--
1.8.3.1
\
 
 \ /
  Last update: 2019-03-28 18:11    [W:0.060 / U:38.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site