Module Name:    src
Committed By:   maxv
Date:           Thu Jul 10 19:21:46 UTC 2014

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

Log Message:
Simplify a bit


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/kern/sys_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/sys_module.c
diff -u src/sys/kern/sys_module.c:1.15 src/sys/kern/sys_module.c:1.16
--- src/sys/kern/sys_module.c:1.15	Thu Jul 10 19:12:07 2014
+++ src/sys/kern/sys_module.c	Thu Jul 10 19:21:46 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sys_module.c,v 1.15 2014/07/10 19:12:07 maxv Exp $	*/
+/*	$NetBSD: sys_module.c,v 1.16 2014/07/10 19:21:46 maxv Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_module.c,v 1.15 2014/07/10 19:12:07 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_module.c,v 1.16 2014/07/10 19:21:46 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -62,36 +62,35 @@ handle_modctl_load(modctl_load_t *ml)
 
 	if ((ml->ml_props != NULL && ml->ml_propslen == 0) ||
 	    (ml->ml_props == NULL && ml->ml_propslen > 0)) {
-		error = EINVAL;
-		goto out1;
+		return EINVAL;
 	}
 
 	path = PNBUF_GET();
 	error = copyinstr(ml->ml_filename, path, MAXPATHLEN, NULL);
 	if (error != 0)
-		goto out2;
+		goto out1;
 
 	if (ml->ml_props != NULL) {
 		if (ml->ml_propslen > MAXPROPSLEN) {
 			error = ENOMEM;
-			goto out2;
+			goto out1;
 		}
 		propslen = ml->ml_propslen + 1;
 
 		props = (char *)kmem_alloc(propslen, KM_SLEEP);
 		if (props == NULL) {
 			error = ENOMEM;
-			goto out2;
+			goto out1;
 		}
 
 		error = copyinstr(ml->ml_props, props, propslen, NULL);
 		if (error != 0)
-			goto out3;
+			goto out2;
 
 		dict = prop_dictionary_internalize(props);
 		if (dict == NULL) {
 			error = EINVAL;
-			goto out3;
+			goto out2;
 		}
 	} else {
 		dict = NULL;
@@ -104,14 +103,12 @@ handle_modctl_load(modctl_load_t *ml)
 		prop_object_release(dict);
 	}
 
-out3:
+out2:
 	if (props != NULL) {
 		kmem_free(props, propslen);
 	}
-out2:
-	PNBUF_PUT(path);
 out1:
-
+	PNBUF_PUT(path);
 	return error;
 }
 

Reply via email to