If dm_get_major_minor failed, log with major and minor should not
be printed to avoid major and minor used before initialization.

V1->V2: set major and minor to -1 at begining

Signed-off-by: Lixiaokeng <[email protected]>
Signed-off-by: Zhiqiang Liu <[email protected]>
Signed-off-by: Linfeilong <[email protected]>
---
 multipathd/cli_handlers.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
index 8db37961..e9698704 100644
--- a/multipathd/cli_handlers.c
+++ b/multipathd/cli_handlers.c
@@ -820,7 +820,7 @@ cli_add_map (void * v, char ** reply, int * len, void * 
data)
 {
        struct vectors * vecs = (struct vectors *)data;
        char * param = get_keyparam(v, MAP);
-       int major, minor;
+       int major = -1, minor = -1;
        char dev_path[PATH_SIZE];
        char *refwwid, *alias = NULL;
        int rc, count = 0;
--

--
dm-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/dm-devel

Reply via email to