Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci If attach fails, don't panic on detach.



details:   https://anonhg.NetBSD.org/src/rev/120ba0ad4969
branches:  trunk
changeset: 461270:120ba0ad4969
user:      ad <ad%NetBSD.org@localhost>
date:      Thu Nov 21 17:47:23 2019 +0000

description:
If attach fails, don't panic on detach.

diffstat:

 sys/dev/pci/ichsmb.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 25a00def1ebe -r 120ba0ad4969 sys/dev/pci/ichsmb.c
--- a/sys/dev/pci/ichsmb.c      Thu Nov 21 16:45:05 2019 +0000
+++ b/sys/dev/pci/ichsmb.c      Thu Nov 21 17:47:23 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ichsmb.c,v 1.60 2018/12/10 06:23:54 jdolecek Exp $     */
+/*     $NetBSD: ichsmb.c,v 1.61 2019/11/21 17:47:23 ad Exp $   */
 /*     $OpenBSD: ichiic.c,v 1.18 2007/05/03 09:36:26 dlg Exp $ */
 
 /*
@@ -22,7 +22,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.60 2018/12/10 06:23:54 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ichsmb.c,v 1.61 2019/11/21 17:47:23 ad Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -265,7 +265,8 @@
                sc->sc_pihp = NULL;
        }
 
-       bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_size);
+       if (sc->sc_size != 0)
+               bus_space_unmap(sc->sc_iot, sc->sc_ioh, sc->sc_size);
 
        return 0;
 }



Home | Main Index | Thread Index | Old Index