Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Do not try to unload the pciverbose module if it...



details:   https://anonhg.NetBSD.org/src/rev/4e2dcfdc2891
branches:  trunk
changeset: 755176:4e2dcfdc2891
user:      martin <martin%NetBSD.org@localhost>
date:      Wed May 26 09:42:42 2010 +0000

description:
Do not try to unload the pciverbose module if it had never been loaded.

diffstat:

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

diffs (34 lines):

diff -r bd9bb60654cb -r 4e2dcfdc2891 sys/dev/pci/pci_subr.c
--- a/sys/dev/pci/pci_subr.c    Wed May 26 01:10:10 2010 +0000
+++ b/sys/dev/pci/pci_subr.c    Wed May 26 09:42:42 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pci_subr.c,v 1.81 2010/05/25 08:35:45 pgoyette Exp $   */
+/*     $NetBSD: pci_subr.c,v 1.82 2010/05/26 09:42:42 martin Exp $     */
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.81 2010/05/25 08:35:45 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.82 2010/05/26 09:42:42 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_pci.h"
@@ -328,10 +328,13 @@
 
        if (load) {
                if (loaded++ == 0)
-                       module_load("pciverbose", MODCTL_LOAD_FORCE, NULL,
-                                   MODULE_CLASS_MISC);
+                       if (module_load("pciverbose", MODCTL_LOAD_FORCE, NULL,
+                                   MODULE_CLASS_MISC) !=0 )
+                               loaded = 0;
                return;
        }
+       if (loaded == 0)
+               return;
        if (--loaded == 0)
                module_unload("pciverbose");
 }



Home | Main Index | Thread Index | Old Index