[dm-devel] [PATCH 1/4] libmultipath: group_by_prio: fix signedness bug

Martin Wilck mwilck at suse.com
Thu Apr 11 10:49:20 UTC 2019


pp->priority can be negative, so we we shouldn't compare
it with an unsigned int.

Signed-off-by: Martin Wilck <mwilck at suse.com>
---
 libmultipath/pgpolicies.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libmultipath/pgpolicies.c b/libmultipath/pgpolicies.c
index ac2596ad..660768a4 100644
--- a/libmultipath/pgpolicies.c
+++ b/libmultipath/pgpolicies.c
@@ -312,7 +312,7 @@ out:
 int group_by_prio(struct multipath *mp)
 {
 	int i;
-	unsigned int prio;
+	int prio;
 	struct path * pp;
 	struct pathgroup * pgp;
 	vector pathvec = NULL;
-- 
2.21.0




More information about the dm-devel mailing list