From 6a0e54f84fc7f45e8931ded387b5864aa18bf933 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 24 Aug 2023 15:30:45 +0200 Subject: [PATCH] clang: ensure status is initilized Initialize status before handling error path. --- lib/metadata/lv_manip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 9bec8b54d..f9bc3c34e 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -5036,6 +5036,9 @@ static int _fsadm_cmd(enum fsadm_cmd_e fcmd, find_config_tree_str(cmd, global_fsadm_executable_CFG, NULL) }; + if (status) + *status = -1; + if (!argv[0] || !*argv[0]) { log_error("Cannot use misconfigured fsadm executable to resize %s.", display_lvname(lv)); return 0; @@ -5055,9 +5058,6 @@ static int _fsadm_cmd(enum fsadm_cmd_e fcmd, argv[i++] = (fcmd == FSADM_CMD_RESIZE) ? "resize" : "check"; - if (status) - *status = -1; - if (dm_snprintf(lv_path, sizeof(lv_path), "%s%s/%s", cmd->dev_dir, vg->name, lv->name) < 0) { log_error("Couldn't create LV path for %s.", display_lvname(lv));