]> git.baikalelectronics.ru Git - kernel.git/commit
vhost/vsock: fix uninitialized vhost_vsock->guest_cid
authorStefan Hajnoczi <stefanha@redhat.com>
Thu, 9 Nov 2017 13:29:10 +0000 (13:29 +0000)
committerMichael S. Tsirkin <mst@redhat.com>
Tue, 14 Nov 2017 21:57:40 +0000 (23:57 +0200)
commita11404fbd12000f085e0c15e7482c2ee187d31ef
treeddc2e24355087e2f72179b4b6e01cd27d415f974
parent0868f1cd99bf3f341d429e9df995bc8db1447921
vhost/vsock: fix uninitialized vhost_vsock->guest_cid

The vhost_vsock->guest_cid field is uninitialized when /dev/vhost-vsock
is opened until the VHOST_VSOCK_SET_GUEST_CID ioctl is called.

kvmalloc(..., GFP_KERNEL | __GFP_RETRY_MAYFAIL) does not zero memory.
All other vhost_vsock fields are initialized explicitly so just
initialize this field too.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
drivers/vhost/vsock.c