Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/hyperv Zero clear the allocated ring buffer for vmbu...



details:   https://anonhg.NetBSD.org/src/rev/9c2eb76f8e48
branches:  trunk
changeset: 842506:9c2eb76f8e48
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Tue Jul 09 10:07:11 2019 +0000

description:
Zero clear the allocated ring buffer for vmbus_channel.
This change makes Hyper-V's vmbus devices work properly even after reboot.

diffstat:

 sys/dev/hyperv/vmbus.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 981deaa21f00 -r 9c2eb76f8e48 sys/dev/hyperv/vmbus.c
--- a/sys/dev/hyperv/vmbus.c    Tue Jul 09 08:46:58 2019 +0000
+++ b/sys/dev/hyperv/vmbus.c    Tue Jul 09 10:07:11 2019 +0000
@@ -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 @@
                    "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;



Home | Main Index | Thread Index | Old Index