diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c index dd0fb0b304..35b0bdc478 100644 --- a/cmd/zpool/zpool_main.c +++ b/cmd/zpool/zpool_main.c @@ -3243,7 +3243,7 @@ print_scan_status(pool_scan_stat_t *ps) */ if (ps->pss_state == DSS_FINISHED) { uint64_t minutes_taken = (end - start) / 60; - char *fmt; + char *fmt = NULL; if (ps->pss_func == POOL_SCAN_SCRUB) { fmt = gettext("scrub repaired %s in %lluh%um with " diff --git a/module/zfs/dmu_objset.c b/module/zfs/dmu_objset.c index 690e6ecdee..9bd09c9db6 100644 --- a/module/zfs/dmu_objset.c +++ b/module/zfs/dmu_objset.c @@ -1215,7 +1215,7 @@ dmu_objset_userquota_get_ids(dnode_t *dn, boolean_t before, dmu_tx_t *tx) objset_t *os = dn->dn_objset; void *data = NULL; dmu_buf_impl_t *db = NULL; - uint64_t *user, *group; + uint64_t *user = NULL, *group = NULL; int flags = dn->dn_id_flags; int error; boolean_t have_spill = B_FALSE; diff --git a/module/zfs/sa.c b/module/zfs/sa.c index a91b379f99..cf232c2b64 100644 --- a/module/zfs/sa.c +++ b/module/zfs/sa.c @@ -637,7 +637,7 @@ sa_build_layouts(sa_handle_t *hdl, sa_bulk_attr_t *attr_desc, int attr_count, int buf_space; sa_attr_type_t *attrs, *attrs_start; int i, lot_count; - int hdrsize, spillhdrsize; + int hdrsize, spillhdrsize = 0; int used; dmu_object_type_t bonustype; sa_lot_t *lot; @@ -1541,7 +1541,7 @@ sa_modify_attrs(sa_handle_t *hdl, sa_attr_type_t newattr, sa_bulk_attr_t *attr_desc; void *old_data[2]; int bonus_attr_count = 0; - int bonus_data_size, spill_data_size; + int bonus_data_size = 0, spill_data_size = 0; int spill_attr_count = 0; int error; uint16_t length; diff --git a/module/zfs/zil.c b/module/zfs/zil.c index 4aa4d10b07..ff25fd2233 100644 --- a/module/zfs/zil.c +++ b/module/zfs/zil.c @@ -287,6 +287,8 @@ zil_parse(zilog_t *zilog, zil_parse_blk_func_t *parse_blk_func, char *lrbuf, *lrp; int error = 0; + bzero(&next_blk, sizeof(blkptr_t)); + /* * Old logs didn't record the maximum zh_claim_lr_seq. */ @@ -308,7 +310,7 @@ zil_parse(zilog_t *zilog, zil_parse_blk_func_t *parse_blk_func, for (blk = zh->zh_log; !BP_IS_HOLE(&blk); blk = next_blk) { uint64_t blk_seq = blk.blk_cksum.zc_word[ZIL_ZC_SEQ]; int reclen; - char *end; + char *end = NULL; if (blk_seq > claim_blk_seq) break;