diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 18a94da1f744..c6d5292575de 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -3066,7 +3066,7 @@ open_objset(const char *path, const void *tag, objset_t **osp) } sa_os = *osp; - return (0); + return (err); } static void diff --git a/lib/libzpool/util.c b/lib/libzpool/util.c index 0ce7822a3563..a310255d7a7d 100644 --- a/lib/libzpool/util.c +++ b/lib/libzpool/util.c @@ -229,13 +229,14 @@ set_global_var(char const *arg) fprintf(stderr, "Failed to open libzpool.so to set global " "variable\n"); ret = EIO; - goto out_dlclose; + goto out_free; } ret = 0; out_dlclose: dlclose(zpoolhdl); +out_free: free(varname); out_ret: return (ret); diff --git a/module/icp/io/sha2_mod.c b/module/icp/io/sha2_mod.c index fadb58b81881..a58f0982c8c0 100644 --- a/module/icp/io/sha2_mod.c +++ b/module/icp/io/sha2_mod.c @@ -737,12 +737,15 @@ sha2_mac_init(crypto_ctx_t *ctx, crypto_mechanism_t *mechanism, */ if (mechanism->cm_type % 3 == 2) { if (mechanism->cm_param == NULL || - mechanism->cm_param_len != sizeof (ulong_t)) - ret = CRYPTO_MECHANISM_PARAM_INVALID; - PROV_SHA2_GET_DIGEST_LEN(mechanism, - PROV_SHA2_HMAC_CTX(ctx)->hc_digest_len); - if (PROV_SHA2_HMAC_CTX(ctx)->hc_digest_len > sha_digest_len) + mechanism->cm_param_len != sizeof (ulong_t)) { ret = CRYPTO_MECHANISM_PARAM_INVALID; + } else { + PROV_SHA2_GET_DIGEST_LEN(mechanism, + PROV_SHA2_HMAC_CTX(ctx)->hc_digest_len); + if (PROV_SHA2_HMAC_CTX(ctx)->hc_digest_len > + sha_digest_len) + ret = CRYPTO_MECHANISM_PARAM_INVALID; + } } if (ret != CRYPTO_SUCCESS) { diff --git a/module/zfs/fm.c b/module/zfs/fm.c index 32b5cf8facd1..3f05d759770b 100644 --- a/module/zfs/fm.c +++ b/module/zfs/fm.c @@ -955,6 +955,7 @@ fm_fmri_hc_create(nvlist_t *fmri, int version, const nvlist_t *auth, } atomic_inc_64( &erpt_kstat_data.fmri_set_failed.value.ui64); + va_end(ap); return; } } diff --git a/module/zfs/spa.c b/module/zfs/spa.c index 0a9f31a8fc85..5d568e8340d6 100644 --- a/module/zfs/spa.c +++ b/module/zfs/spa.c @@ -5267,7 +5267,7 @@ spa_open_common(const char *pool, spa_t **spapp, const void *tag, * If we've recovered the pool, pass back any information we * gathered while doing the load. */ - if (state == SPA_LOAD_RECOVER) { + if (state == SPA_LOAD_RECOVER && config != NULL) { fnvlist_add_nvlist(*config, ZPOOL_CONFIG_LOAD_INFO, spa->spa_load_info); } diff --git a/module/zfs/zap_micro.c b/module/zfs/zap_micro.c index 58a5c9f600b7..4bf8a322e91b 100644 --- a/module/zfs/zap_micro.c +++ b/module/zfs/zap_micro.c @@ -990,8 +990,10 @@ zap_lookup_impl(zap_t *zap, const char *name, } else { *(uint64_t *)buf = MZE_PHYS(zap, mze)->mze_value; - (void) strlcpy(realname, - MZE_PHYS(zap, mze)->mze_name, rn_len); + if (realname != NULL) + (void) strlcpy(realname, + MZE_PHYS(zap, mze)->mze_name, + rn_len); if (ncp) { *ncp = mzap_normalization_conflict(zap, zn, mze);