summaryrefslogtreecommitdiffstats
path: root/sys/dev/vnd.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2011-06-02 19:10:19 +0000
committerderaadt <deraadt@openbsd.org>2011-06-02 19:10:19 +0000
commit1c84d2fe2f21a3854cb949ff5ed241ebcefa1db9 (patch)
treef5ce6c76918b0b59c9f98b002ecdd5d44cb58bbd /sys/dev/vnd.c
parentDo not bzero the softc when doing VNDIOCCLR, because that trashes the (diff)
downloadwireguard-openbsd-1c84d2fe2f21a3854cb949ff5ed241ebcefa1db9.tar.xz
wireguard-openbsd-1c84d2fe2f21a3854cb949ff5ed241ebcefa1db9.zip
Initialize the dv_unit, because disk_attach will want it later. Before
we were probably only ever reading labels off vnd0. Oops. Spotted by matthew
Diffstat (limited to 'sys/dev/vnd.c')
-rw-r--r--sys/dev/vnd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c
index fa7918073f9..54cb6d94066 100644
--- a/sys/dev/vnd.c
+++ b/sys/dev/vnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vnd.c,v 1.118 2011/06/02 19:09:29 deraadt Exp $ */
+/* $OpenBSD: vnd.c,v 1.119 2011/06/02 19:10:19 deraadt Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
@@ -182,6 +182,7 @@ vndattach(int num)
vnd_softc = (struct vnd_softc *)mem;
for (i = 0; i < num; i++) {
rw_init(&vnd_softc[i].sc_rwlock, "vndlock");
+ vnd_softc[i].sc_dev.dv_unit = i;
device_ref(&vnd_softc[i].sc_dev);
}
numvnd = num;