summaryrefslogtreecommitdiff
path: root/sys/dev/hyperv
diff options
context:
space:
mode:
authornakayama <nakayama@NetBSD.org>2019-07-09 10:07:11 +0000
committernakayama <nakayama@NetBSD.org>2019-07-09 10:07:11 +0000
commitf52a0928279a5ca61f267caa39142fe1e535e007 (patch)
tree2d2eaffa1655b1c35afd7a534dbe3c6de4f5e6ae /sys/dev/hyperv
parent586908d303a44bf79a844c0d489c5031debe07f0 (diff)
Zero clear the allocated ring buffer for vmbus_channel.
This change makes Hyper-V's vmbus devices work properly even after reboot.
Diffstat (limited to 'sys/dev/hyperv')
-rw-r--r--sys/dev/hyperv/vmbus.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/hyperv/vmbus.c b/sys/dev/hyperv/vmbus.c
index 776aa7cea6c..7a91b79a923 100644
--- a/sys/dev/hyperv/vmbus.c
+++ b/sys/dev/hyperv/vmbus.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vmbus.c,v 1.3 2019/05/24 14:28:48 nonaka Exp $ */
+/* $NetBSD: vmbus.c,v 1.4 2019/07/09 10:07:11 nakayama Exp $ */
/* $OpenBSD: hyperv.c,v 1.43 2017/06/27 13:56:15 mikeb Exp $ */
/*-
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vmbus.c,v 1.3 2019/05/24 14:28:48 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vmbus.c,v 1.4 2019/07/09 10:07:11 nakayama Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1263,6 +1263,7 @@ vmbus_channel_ring_create(struct vmbus_channel *ch, uint32_t buflen)
"failed to allocate channel ring\n");
return ENOMEM;
}
+ memset(ch->ch_ring, 0, ch->ch_ring_size);
memset(&ch->ch_wrd, 0, sizeof(ch->ch_wrd));
ch->ch_wrd.rd_ring = (struct vmbus_bufring *)ch->ch_ring;