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/f70cc49339c8
branches:  trunk
changeset: 465401:f70cc49339c8
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 e38c3b6f15fa -r f70cc49339c8 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