summaryrefslogtreecommitdiffstats
path: root/sys/boot/zfs/zfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/boot/zfs/zfs.c')
-rw-r--r--sys/boot/zfs/zfs.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/boot/zfs/zfs.c b/sys/boot/zfs/zfs.c
index fdb79bb..c8b1284 100644
--- a/sys/boot/zfs/zfs.c
+++ b/sys/boot/zfs/zfs.c
@@ -413,7 +413,7 @@ struct zfs_probe_args {
int fd;
const char *devname;
uint64_t *pool_guid;
- uint16_t secsz;
+ u_int secsz;
};
static int
@@ -712,13 +712,18 @@ zfs_list(const char *name)
int
zfs_bootenv(const char *name)
{
- static char poolname[ZFS_MAXNAMELEN], *dsname;
+ static char poolname[ZFS_MAXNAMELEN], *dsname, *root;
char becount[4];
uint64_t objid;
spa_t *spa;
int len, rv, pages, perpage, currpage;
- if (strcmp(name, getenv("zfs_be_root")) != 0) {
+ if (name == NULL)
+ return (EINVAL);
+ if ((root = getenv("zfs_be_root")) == NULL)
+ return (EINVAL);
+
+ if (strcmp(name, root) != 0) {
if (setenv("zfs_be_root", name, 1) != 0)
return (ENOMEM);
}
OpenPOWER on IntegriCloud