Module Name: src Committed By: jdolecek Date: Thu Oct 25 21:03:19 UTC 2018
Modified Files: src/sys/dev/pci: ahcisata_pci.c siisata_pci.c Log Message: release intr if pci_intr_establish_xname() fails To generate a diff of this commit: cvs rdiff -u -r1.41 -r1.42 src/sys/dev/pci/ahcisata_pci.c cvs rdiff -u -r1.19 -r1.20 src/sys/dev/pci/siisata_pci.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/ahcisata_pci.c diff -u src/sys/dev/pci/ahcisata_pci.c:1.41 src/sys/dev/pci/ahcisata_pci.c:1.42 --- src/sys/dev/pci/ahcisata_pci.c:1.41 Wed Oct 24 19:38:00 2018 +++ src/sys/dev/pci/ahcisata_pci.c Thu Oct 25 21:03:19 2018 @@ -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 @@ ahci_pci_attach(device_t parent, device_ 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; } Index: src/sys/dev/pci/siisata_pci.c diff -u src/sys/dev/pci/siisata_pci.c:1.19 src/sys/dev/pci/siisata_pci.c:1.20 --- src/sys/dev/pci/siisata_pci.c:1.19 Wed Oct 24 19:38:00 2018 +++ src/sys/dev/pci/siisata_pci.c Thu Oct 25 21:03:19 2018 @@ -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 @@ siisata_pci_attach(device_t parent, devi 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",