summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authoruwe <uwe@NetBSD.org>2022-04-20 22:08:10 +0000
committeruwe <uwe@NetBSD.org>2022-04-20 22:08:10 +0000
commitd62ea836284cb39775eb4752e7307a160802624f (patch)
tree1a540c036b9ad1f711dee81410fa004602bbbfed /sys/dev
parentb6e8820c0d8a0c799accf772729e005192218c74 (diff)
vio9p: avoid null pointer dereference on attach.
Pass "vqs" argument to virtio_child_attach_start(). The virtio API is not quite clear to me here - there's also a separate setter virtio_child_attach_set_vqs that performs some additional actions. Queue setup for Virtio 1.0 accesses virtio_softc::sc_vqs and we didn't set it. QEMU exposes only the old virtio interface, so it doesn't trigger the problem.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/pci/vio9p.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pci/vio9p.c b/sys/dev/pci/vio9p.c
index adec9026bee..beed4ee322c 100644
--- a/sys/dev/pci/vio9p.c
+++ b/sys/dev/pci/vio9p.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vio9p.c,v 1.8 2022/04/13 15:24:42 uwe Exp $ */
+/* $NetBSD: vio9p.c,v 1.9 2022/04/20 22:08:10 uwe Exp $ */
/*
* Copyright (c) 2019 Internet Initiative Japan, Inc.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vio9p.c,v 1.8 2022/04/13 15:24:42 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vio9p.c,v 1.9 2022/04/20 22:08:10 uwe Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -500,7 +500,7 @@ vio9p_attach(device_t parent, device_t self, void *aux)
sc->sc_dev = self;
sc->sc_virtio = vsc;
- virtio_child_attach_start(vsc, self, IPL_VM, NULL,
+ virtio_child_attach_start(vsc, self, IPL_VM, sc->sc_vq,
NULL, virtio_vq_intr,
VIRTIO_F_INTR_MPSAFE | VIRTIO_F_INTR_SOFTINT,
VIO9P_F_MOUNT_TAG,