The 'wwid' in struct multipath is a static array, so a check for
the existence of 'wwid' is pointless. We should rather check if
the argument 'refwwid' is not NULL and has a length larger then '0'.

Signed-off-by: Hannes Reinecke <[email protected]>
---
 multipath/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/multipath/main.c b/multipath/main.c
index 93376a9..ee00fdbd 100644
--- a/multipath/main.c
+++ b/multipath/main.c
@@ -212,7 +212,7 @@ get_dm_mpvec (enum mpath_cmds cmd, vector curmp, vector 
pathvec, char * refwwid)
                /*
                 * discard out of scope maps
                 */
-               if (mpp->wwid && refwwid &&
+               if (refwwid && strlen(refwwid) &&
                    strncmp(mpp->wwid, refwwid, WWID_SIZE)) {
                        condlog(3, "skip map %s: out of scope", mpp->alias);
                        free_multipath(mpp, KEEP_PATHS);
-- 
2.6.6

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

Reply via email to