diff options
| author | ad <ad@NetBSD.org> | 2008-11-16 15:47:35 +0000 |
|---|---|---|
| committer | ad <ad@NetBSD.org> | 2008-11-16 15:47:35 +0000 |
| commit | 974cf03d8dffb11d000f3d8137f0219eb246b09f (patch) | |
| tree | a4cfa80048d07df09933b6c9b48c9cee8bfd58d0 /sys/modules | |
| parent | 15fabc9984a5fc38c0e95ff46e29ac0698b9151f (diff) | |
Fail to load if there is no embedded file system image.
Diffstat (limited to 'sys/modules')
| -rw-r--r-- | sys/modules/miniroot/miniroot.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sys/modules/miniroot/miniroot.c b/sys/modules/miniroot/miniroot.c index 0e62aebcdf7..31273e99e96 100644 --- a/sys/modules/miniroot/miniroot.c +++ b/sys/modules/miniroot/miniroot.c @@ -1,4 +1,4 @@ -/* $NetBSD: miniroot.c,v 1.2 2008/11/16 15:46:10 ad Exp $ */ +/* $NetBSD: miniroot.c,v 1.3 2008/11/16 15:47:35 ad Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: miniroot.c,v 1.2 2008/11/16 15:46:10 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: miniroot.c,v 1.3 2008/11/16 15:47:35 ad Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -47,9 +47,14 @@ miniroot_modcmd(modcmd_t cmd, void *arg) switch (cmd) { case MODULE_CMD_INIT: error = module_find_section("miniroot", &addr, &size); - if (error == 0 && size != 0) - md_root_setconf(addr, size); - break; + if (error == 0) { + if (size == 0) { + error = EINVAL; + } else { + md_root_setconf(addr, size); + } + } + return error; case MODULE_CMD_FINI: return EOPNOTSUPP; @@ -57,6 +62,4 @@ miniroot_modcmd(modcmd_t cmd, void *arg) default: return ENOTTY; } - - return 0; } |
