diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c index cc520d38f..7ad7f81e8 100644 --- a/daemons/dmeventd/dmeventd.c +++ b/daemons/dmeventd/dmeventd.c @@ -865,6 +865,7 @@ static int _event_wait(struct thread_status *thread) * This is so that you can break out of waiting on an event, * either for a timeout event, or to cancel the thread. */ + sigemptyset(&old); sigemptyset(&set); sigaddset(&set, SIGALRM); if (pthread_sigmask(SIG_UNBLOCK, &set, &old) != 0) { diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index 9b98c927a..29727df94 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -1787,7 +1787,7 @@ struct pool_cb_data { static int _pool_callback(struct dm_tree_node *node, dm_node_callback_t type, void *cb_data) { - int ret, status, fd; + int ret, status = 0, fd; const struct dm_config_node *cn; const struct dm_config_value *cv; const struct pool_cb_data *data = cb_data; diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c index 05f5ea017..6d140afaa 100644 --- a/libdm/libdm-report.c +++ b/libdm/libdm-report.c @@ -2626,7 +2626,7 @@ static const char *_tok_value_string_list(const struct dm_report_field_type *ft, "for selection field %s."; struct selection_str_list *ssl = NULL; struct dm_str_list *item; - const char *begin_item, *end_item, *tmp; + const char *begin_item = NULL, *end_item = NULL, *tmp; uint32_t op_flags, end_op_flag_expected, end_op_flag_hit = 0; struct dm_str_list **arr; size_t list_size; diff --git a/tools/lvconvert.c b/tools/lvconvert.c index 50c77d8e6..848007281 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -1158,10 +1158,10 @@ static int _lvconvert_mirrors(struct cmd_context *cmd, struct logical_volume *lv, struct lvconvert_params *lp) { - uint32_t old_mimage_count; - uint32_t old_log_count; - uint32_t new_mimage_count; - uint32_t new_log_count; + uint32_t old_mimage_count = 0; + uint32_t old_log_count = 0; + uint32_t new_mimage_count = 0; + uint32_t new_log_count = 0; if ((lp->corelog || lp->mirrorlog) && *lp->type_str && strcmp(lp->type_str, SEG_TYPE_NAME_MIRROR)) { log_error("--corelog and --mirrorlog are only compatible with mirror devices."); diff --git a/tools/toollib.c b/tools/toollib.c index 7eb0beda3..3b89568c1 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -2723,9 +2723,9 @@ static int _check_lv_rules(struct cmd_context *cmd, struct logical_volume *lv) char buf[64]; struct cmd_rule *rule; struct lv_type *lvtype = NULL; - uint64_t lv_props_match_bits, lv_props_unmatch_bits; - uint64_t lv_types_match_bits, lv_types_unmatch_bits; - int opts_match_count, opts_unmatch_count; + uint64_t lv_props_match_bits = 0, lv_props_unmatch_bits = 0; + uint64_t lv_types_match_bits = 0, lv_types_unmatch_bits = 0; + int opts_match_count = 0, opts_unmatch_count = 0; int lvt_enum; int ret = 1; int i;