From: sf Date: Thu, 19 Sep 2024 06:19:05 +0000 (+0000) Subject: virtio_pci: Fix off-by-one in interrupt setup X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=01d04b3e8a99c1fdeeed457acd3730c567c8be56;p=openbsd virtio_pci: Fix off-by-one in interrupt setup This was introduced by "virtio: Move interrupt setup into separate function". ok jan@ --- diff --git a/sys/dev/pci/virtio_pci.c b/sys/dev/pci/virtio_pci.c index 4a0c9037cf7..f9c8801ceb7 100644 --- a/sys/dev/pci/virtio_pci.c +++ b/sys/dev/pci/virtio_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: virtio_pci.c,v 1.42 2024/09/02 08:26:26 sf Exp $ */ +/* $OpenBSD: virtio_pci.c,v 1.43 2024/09/19 06:19:05 sf Exp $ */ /* $NetBSD: virtio.c,v 1.3 2011/11/02 23:05:52 njoly Exp $ */ /* @@ -284,7 +284,7 @@ virtio_pci_setup_intrs(struct virtio_softc *vsc) if (sc->sc_irq_type == IRQ_NO_MSIX) return; - for (i = 0; i <= vsc->sc_nvqs; i++) { + for (i = 0; i < vsc->sc_nvqs; i++) { unsigned vec = vsc->sc_vqs[i].vq_intr_vec; virtio_pci_set_msix_queue_vector(sc, i, vec); }