diff mbox

[3/3] multipath: fixup check for out-of-scope maps

Message ID 1470727873-10502-4-git-send-email-hare@suse.de (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

Hannes Reinecke Aug. 9, 2016, 7:31 a.m. UTC
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 <hare@suse.com>
---
 multipath/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

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);