Blame SOURCES/0052-RH-fix-bad-derefs.patch

38852f
---
38852f
 multipathd/cli_handlers.c |    3 ++-
38852f
 multipathd/main.c         |   12 ++++++------
38852f
 2 files changed, 8 insertions(+), 7 deletions(-)
38852f
38852f
Index: multipath-tools-130222/multipathd/cli_handlers.c
38852f
===================================================================
38852f
--- multipath-tools-130222.orig/multipathd/cli_handlers.c
38852f
+++ multipath-tools-130222/multipathd/cli_handlers.c
38852f
@@ -632,7 +632,8 @@ cli_resize(void *v, char **reply, int *l
38852f
 		return 1;
38852f
 
38852f
 	dm_lib_release();
38852f
-	setup_multipath(vecs, mpp);
38852f
+	if (setup_multipath(vecs, mpp) != 0)
38852f
+		return 1;
38852f
 	sync_map_state(mpp);
38852f
 
38852f
 	return 0;
38852f
Index: multipath-tools-130222/multipathd/main.c
38852f
===================================================================
38852f
--- multipath-tools-130222.orig/multipathd/main.c
38852f
+++ multipath-tools-130222/multipathd/main.c
38852f
@@ -134,7 +134,6 @@ coalesce_maps(struct vectors *vecs, vect
38852f
 	struct multipath * ompp;
38852f
 	vector ompv = vecs->mpvec;
38852f
 	unsigned int i;
38852f
-	int j;
38852f
 
38852f
 	vector_foreach_slot (ompv, ompp, i) {
38852f
 		if (!find_mp_by_wwid(nmpv, ompp->wwid)) {
38852f
@@ -148,16 +147,17 @@ coalesce_maps(struct vectors *vecs, vect
38852f
 				/*
38852f
 				 * may be just because the device is open
38852f
 				 */
38852f
+				if (setup_multipath(vecs, ompp) != 0) {
38852f
+					i--;
38852f
+					continue;
38852f
+				}
38852f
 				if (!vector_alloc_slot(nmpv))
38852f
 					return 1;
38852f
 
38852f
 				vector_set_slot(nmpv, ompp);
38852f
-				setup_multipath(vecs, ompp);
38852f
 
38852f
-				if ((j = find_slot(ompv, (void *)ompp)) != -1)
38852f
-					vector_del_slot(ompv, j);
38852f
-
38852f
-				continue;
38852f
+				vector_del_slot(ompv, i);
38852f
+				i--;
38852f
 			}
38852f
 			else {
38852f
 				dm_lib_release();