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

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