libmultipath: set pp->checkint in store_pathinfo()
authorMartin Wilck <mwilck@suse.com>
Fri, 2 Nov 2018 12:23:56 +0000 (13:23 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Wed, 14 Nov 2018 07:22:20 +0000 (08:22 +0100)
store_pathinfo is called with valid conf pointer anyway, so
checkint is available. pp->checkint is now valid for every
path after path_discovery().

This fixes a bad conf access in cli_add_path().

Reviewed-by: Benjamin Marzinski <bmarzins@redhat.com>
Signed-off-by: Martin Wilck <mwilck@suse.com>
libmultipath/discovery.c
multipathd/cli_handlers.c
multipathd/main.c

index a6159e4..63558ad 100644 (file)
@@ -103,6 +103,7 @@ store_pathinfo (vector pathvec, struct config *conf,
        err = store_path(pathvec, pp);
        if (err)
                goto out;
+       pp->checkint = conf->checkint;
 
 out:
        if (err)
index 7500080..4aea4ce 100644 (file)
@@ -736,7 +736,6 @@ cli_add_path (void * v, char ** reply, int * len, void * data)
                        condlog(0, "%s: failed to store path info", param);
                        return 1;
                }
-               pp->checkint = conf->checkint;
        }
        return ev_add_path(pp, vecs, 1);
 blacklisted:
index c57aa39..958545a 100644 (file)
@@ -2324,8 +2324,6 @@ configure (struct vectors * vecs)
                        free_path(pp);
                        i--;
                }
-               else
-                       pp->checkint = conf->checkint;
                pthread_cleanup_pop(1);
        }
        if (map_discovery(vecs)) {