summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/vfs_conf.c')
-rw-r--r--sys/kern/vfs_conf.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/kern/vfs_conf.c b/sys/kern/vfs_conf.c
index 2e5360a5..20d9b90 100644
--- a/sys/kern/vfs_conf.c
+++ b/sys/kern/vfs_conf.c
@@ -102,7 +102,8 @@ dev_t rootdev = NODEV;
void
vfs_mountroot(void *foo __unused)
{
- int i;
+ char *cp;
+ int i, error;
/*
* The root filesystem information is compiled in, and we are
@@ -139,8 +140,12 @@ vfs_mountroot(void *foo __unused)
* supplied via some other means. This is the preferred
* mechanism.
*/
- if (!vfs_mountroot_try(getenv("vfs.root.mountfrom")))
- return;
+ if ((cp = getenv("vfs.root.mountfrom")) != NULL) {
+ error = vfs_mountroot_try(cp);
+ freeenv(cp);
+ if (!error)
+ return;
+ }
/*
* Try values that may have been computed by the machine-dependant
OpenPOWER on IntegriCloud