Module Name:    src
Committed By:   christos
Date:           Wed Sep 14 12:29:22 UTC 2011

Modified Files:
        src/sys/kern: kern_module.c

Log Message:
don't increment the number of referenced module as a side effect if we fail.
>From jmcneill


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/kern/kern_module.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/kern/kern_module.c
diff -u src/sys/kern/kern_module.c:1.80 src/sys/kern/kern_module.c:1.81
--- src/sys/kern/kern_module.c:1.80	Sat Aug 13 17:04:06 2011
+++ src/sys/kern/kern_module.c	Wed Sep 14 08:29:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_module.c,v 1.80 2011/08/13 21:04:06 christos Exp $	*/
+/*	$NetBSD: kern_module.c,v 1.81 2011/09/14 12:29:22 christos Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.80 2011/08/13 21:04:06 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.81 2011/09/14 12:29:22 christos Exp $");
 
 #define _MODULE_INTERNAL
 
@@ -1032,10 +1032,10 @@
 				goto fail;
 			}
 			error = module_do_load(buf, true, flags, NULL,
-			    &mod->mod_required[mod->mod_nrequired++],
-			    MODULE_CLASS_ANY, true);
+			    &mod2, MODULE_CLASS_ANY, true);
 			if (error != 0)
 				goto fail;
+			mod->mod_required[mod->mod_nrequired++] = mod2;
 		}
 	}
 

Reply via email to