diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 037ecfde3e..c8076b1780 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -647,7 +647,7 @@ static int visit_indirect(spa_t *spa, const dnode_phys_t *dnp, blkptr_t *bp, const zbookmark_t *zb) { - int err; + int err = 0; if (bp->blk_birth == 0) return (0); diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c index ea78254f2d..7fb6aa6dbd 100644 --- a/cmd/zfs/zfs_main.c +++ b/cmd/zfs/zfs_main.c @@ -542,7 +542,7 @@ zfs_do_create(int argc, char **argv) { zfs_type_t type = ZFS_TYPE_FILESYSTEM; zfs_handle_t *zhp = NULL; - uint64_t volsize; + uint64_t volsize = 0; int c; boolean_t noreserve = B_FALSE; boolean_t bflag = B_FALSE; @@ -4208,6 +4208,7 @@ main(int argc, char **argv) (void) fprintf(stderr, gettext("unrecognized " "command '%s'\n"), cmdname); usage(B_FALSE); + ret = 1; } } diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index 460c27bc5c..18a402aa6f 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -1373,7 +1373,7 @@ zpool_do_import(int argc, char **argv) char **searchdirs = NULL; int nsearch = 0; int c; - int err; + int err = 1; nvlist_t *pools = NULL; boolean_t do_all = B_FALSE; boolean_t do_destroyed = B_FALSE; @@ -3942,6 +3942,7 @@ main(int argc, char **argv) (void) fprintf(stderr, gettext("unrecognized " "command '%s'\n"), cmdname); usage(B_FALSE); + ret = 1; } libzfs_fini(g_zfs); diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c index f8d16136ee..c82c7b3d18 100644 --- a/cmd/zpool/zpool_vdev.c +++ b/cmd/zpool/zpool_vdev.c @@ -552,7 +552,7 @@ get_replication(nvlist_t *nvroot, boolean_t fatal) uint_t c, children; nvlist_t *nv; char *type; - replication_level_t lastrep, rep, *ret; + replication_level_t lastrep = { 0 }, rep, *ret; boolean_t dontreport; ret = safe_malloc(sizeof (replication_level_t)); diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 3bc201408b..fcfeef4dab 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -1344,7 +1344,7 @@ ztest_dmu_objset_create_destroy(ztest_args_t *za) objects = ztest_random(20); seq = 0; while (objects-- != 0) { - uint64_t object; + uint64_t object = 0; dmu_tx_t *tx = dmu_tx_create(os); dmu_tx_hold_write(tx, DMU_NEW_OBJECT, 0, sizeof (name)); error = dmu_tx_assign(tx, TXG_WAIT); diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index c02123b984..f2adf36ea8 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -1617,7 +1617,7 @@ zfs_perm_get(zfs_handle_t *zhp, zfs_allow_t **zfs_perms) char *nvpname; uid_t uid; gid_t gid; - avl_tree_t *tree; + avl_tree_t *tree = NULL; avl_index_t where; (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); diff --git a/lib/libzfs/libzfs_import.c b/lib/libzfs/libzfs_import.c index 4f58ae8433..4a7634a631 100644 --- a/lib/libzfs/libzfs_import.c +++ b/lib/libzfs/libzfs_import.c @@ -416,7 +416,7 @@ get_configs(libzfs_handle_t *hdl, pool_list_t *pl, boolean_t active_ok) pool_entry_t *pe; vdev_entry_t *ve; config_entry_t *ce; - nvlist_t *ret = NULL, *config = NULL, *tmp, *nvtop, *nvroot; + nvlist_t *ret = NULL, *config = NULL, *tmp = NULL, *nvtop, *nvroot; nvlist_t **spares, **l2cache; uint_t i, nspares, nl2cache; boolean_t config_seen; diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c index b3f09b5fdf..b0662d47d3 100644 --- a/lib/libzfs/libzfs_util.c +++ b/lib/libzfs/libzfs_util.c @@ -889,7 +889,7 @@ zprop_print_one_property(const char *name, zprop_get_cbdata_t *cbp, const char *source) { int i; - const char *str; + const char *str = NULL; char buf[128]; /* diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 9589006d97..ace79ad0ad 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -2609,7 +2609,7 @@ top: uint64_t size = BP_GET_LSIZE(bp); arc_callback_t *acb; vdev_t *vd = NULL; - daddr_t addr; + daddr_t addr = -1; boolean_t devw = B_FALSE; if (hdr == NULL) { diff --git a/module/zfs/dmu.c b/module/zfs/dmu.c index 52373e8b63..b1f3bea77a 100644 --- a/module/zfs/dmu.c +++ b/module/zfs/dmu.c @@ -189,7 +189,7 @@ dmu_buf_hold_array_by_dnode(dnode_t *dn, uint64_t offset, uint32_t flags; int err; zio_t *zio; - hrtime_t start; + hrtime_t start = 0; ASSERT(length <= DMU_MAX_ACCESS);