diff options
author | mm <mm@FreeBSD.org> | 2013-02-23 11:21:05 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2013-02-23 11:21:05 +0000 |
commit | 573dc178949e8bde0eb397715f16a11fac455312 (patch) | |
tree | f15069e3625afc886e4373fe209badca875d2999 /sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c | |
parent | 4432e4c15f8200e334bbff080e7a466c41f1fadd (diff) | |
download | FreeBSD-src-573dc178949e8bde0eb397715f16a11fac455312.zip FreeBSD-src-573dc178949e8bde0eb397715f16a11fac455312.tar.gz |
MFV r246653:
Import vendor change to avoid "unitialized variable" warnings.
Illumos ZFS issues:
3522 zfs module should not allow uninitialized variables
References:
https://www.illumos.org/issues/3522
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c index 5b54448..197e122 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c @@ -560,9 +560,9 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64_t id, cred_t *cr, uint32_t fuid_idx = FUID_INDEX(id); uint32_t rid; idmap_stat status; - uint64_t idx; + uint64_t idx = 0; zfs_fuid_t *zfuid = NULL; - zfs_fuid_info_t *fuidp; + zfs_fuid_info_t *fuidp = NULL; /* * If POSIX ID, or entry is already a FUID then @@ -587,6 +587,9 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64_t id, cred_t *cr, if (fuidp == NULL) return (UID_NOBODY); + VERIFY3U(type, >=, ZFS_OWNER); + VERIFY3U(type, <=, ZFS_ACE_GROUP); + switch (type) { case ZFS_ACE_USER: case ZFS_ACE_GROUP: @@ -603,7 +606,7 @@ zfs_fuid_create(zfsvfs_t *zfsvfs, uint64_t id, cred_t *cr, idx = FUID_INDEX(fuidp->z_fuid_group); break; }; - domain = fuidp->z_domain_table[idx -1]; + domain = fuidp->z_domain_table[idx - 1]; } else { if (type == ZFS_OWNER || type == ZFS_ACE_USER) status = kidmap_getsidbyuid(crgetzone(cr), id, |