Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci release intr if pci_intr_establish_xname() fails



details:   https://anonhg.NetBSD.org/src/rev/85838412d75c
branches:  trunk
changeset: 445371:85838412d75c
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Thu Oct 25 21:03:19 2018 +0000

description:
release intr if pci_intr_establish_xname() fails

diffstat:

 sys/dev/pci/ahcisata_pci.c |  7 +++++--
 sys/dev/pci/siisata_pci.c  |  7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diffs (56 lines):

diff -r e2cf828d7704 -r 85838412d75c sys/dev/pci/ahcisata_pci.c
--- a/sys/dev/pci/ahcisata_pci.c        Thu Oct 25 13:20:01 2018 +0000
+++ b/sys/dev/pci/ahcisata_pci.c        Thu Oct 25 21:03:19 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ahcisata_pci.c,v 1.41 2018/10/24 19:38:00 jdolecek Exp $       */
+/*     $NetBSD: ahcisata_pci.c,v 1.42 2018/10/25 21:03:19 jdolecek Exp $       */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.41 2018/10/24 19:38:00 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ahcisata_pci.c,v 1.42 2018/10/25 21:03:19 jdolecek Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -297,6 +297,9 @@
        psc->sc_ih = pci_intr_establish_xname(pa->pa_pc, psc->sc_pihp[0],
            IPL_BIO, ahci_intr, sc, device_xname(sc->sc_atac.atac_dev));
        if (psc->sc_ih == NULL) {
+               pci_intr_release(psc->sc_pc, psc->sc_pihp, 1);
+               psc->sc_pihp = NULL;
+
                aprint_error_dev(self, "couldn't establish interrupt\n");
                return;
        }
diff -r e2cf828d7704 -r 85838412d75c sys/dev/pci/siisata_pci.c
--- a/sys/dev/pci/siisata_pci.c Thu Oct 25 13:20:01 2018 +0000
+++ b/sys/dev/pci/siisata_pci.c Thu Oct 25 21:03:19 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: siisata_pci.c,v 1.19 2018/10/24 19:38:00 jdolecek Exp $ */
+/* $NetBSD: siisata_pci.c,v 1.20 2018/10/25 21:03:19 jdolecek Exp $ */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -51,7 +51,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: siisata_pci.c,v 1.19 2018/10/24 19:38:00 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: siisata_pci.c,v 1.20 2018/10/25 21:03:19 jdolecek Exp $");
 
 #include <sys/types.h>
 #include <sys/malloc.h>
@@ -222,6 +222,9 @@
        psc->sc_ih = pci_intr_establish_xname(pa->pa_pc, psc->sc_pihp[0],
            IPL_BIO, siisata_intr, sc, device_xname(self));
        if (psc->sc_ih == NULL) {
+               pci_intr_release(psc->sc_pc, psc->sc_pihp, 1);
+               psc->sc_pihp = NULL;
+
                bus_space_unmap(sc->sc_grt, sc->sc_grh, grsize);
                bus_space_unmap(sc->sc_prt, sc->sc_prh, prsize);
                aprint_error_dev(self, "couldn't establish interrupt at %s\n",



Home | Main Index | Thread Index | Old Index