Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci virtio: fix missing release of interrupt resources



details:   https://anonhg.NetBSD.org/src/rev/85b200993c29
branches:  trunk
changeset: 1024386:85b200993c29
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Thu Oct 21 07:08:55 2021 +0000

description:
virtio: fix missing release of interrupt resources

diffstat:

 sys/dev/pci/virtio.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (35 lines):

diff -r df5de7a63212 -r 85b200993c29 sys/dev/pci/virtio.c
--- a/sys/dev/pci/virtio.c      Thu Oct 21 07:03:26 2021 +0000
+++ b/sys/dev/pci/virtio.c      Thu Oct 21 07:08:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: virtio.c,v 1.51 2021/10/21 05:37:43 yamaguchi Exp $    */
+/*     $NetBSD: virtio.c,v 1.52 2021/10/21 07:08:55 yamaguchi Exp $    */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.51 2021/10/21 05:37:43 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: virtio.c,v 1.52 2021/10/21 07:08:55 yamaguchi Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1214,6 +1214,7 @@
        r = sc->sc_ops->setup_interrupts(sc, 0);
        if (r != 0) {
                aprint_error_dev(sc->sc_dev, "failed to setup interrupts\n");
+               goto fail;
        }
 
        KASSERT(sc->sc_soft_ih == NULL);
@@ -1240,6 +1241,8 @@
                sc->sc_soft_ih = NULL;
        }
 
+       sc->sc_ops->free_interrupts(sc);
+
        virtio_set_status(sc, VIRTIO_CONFIG_DEVICE_STATUS_FAILED);
        return 1;
 }



Home | Main Index | Thread Index | Old Index