Blame SOURCES/0018-libmultipath-cleanup-pthread_cleanup_pop-call.patch

5c2e41
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
5c2e41
From: Benjamin Marzinski <bmarzins@redhat.com>
5c2e41
Date: Mon, 26 Nov 2018 16:42:24 -0600
5c2e41
Subject: [PATCH] libmultipath: cleanup pthread_cleanup_pop call
5c2e41
5c2e41
pthread_cleanup_push() and pthread_cleanup_pop() must be called in the
5c2e41
same lexical scope.  In uevent_listen(), the pthread_cleanup_pop() call
5c2e41
to cleanup the udev monitor is called in a nested 'if' block, within
5c2e41
the block where pthread_cleanup_push() is called.  Since this is a
5c2e41
single-statement if block, it doesn't actually cause any problems, but
5c2e41
it should be fixed anyways.
5c2e41
5c2e41
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
5c2e41
---
5c2e41
 libmultipath/uevent.c | 6 +++---
5c2e41
 1 file changed, 3 insertions(+), 3 deletions(-)
5c2e41
5c2e41
diff --git a/libmultipath/uevent.c b/libmultipath/uevent.c
5c2e41
index 5f910e6..f73de8c 100644
5c2e41
--- a/libmultipath/uevent.c
5c2e41
+++ b/libmultipath/uevent.c
5c2e41
@@ -806,7 +806,7 @@ int uevent_listen(struct udev *udev)
5c2e41
 	monitor = udev_monitor_new_from_netlink(udev, "udev");
5c2e41
 	if (!monitor) {
5c2e41
 		condlog(2, "failed to create udev monitor");
5c2e41
-		goto out;
5c2e41
+		goto failback;
5c2e41
 	}
5c2e41
 	pthread_cleanup_push(monitor_cleanup, monitor);
5c2e41
 #ifdef LIBUDEV_API_RECVBUF
5c2e41
@@ -893,8 +893,8 @@ int uevent_listen(struct udev *udev)
5c2e41
 	}
5c2e41
 	need_failback = 0;
5c2e41
 out:
5c2e41
-	if (monitor)
5c2e41
-		pthread_cleanup_pop(1);
5c2e41
+	pthread_cleanup_pop(1);
5c2e41
+failback:
5c2e41
 	if (need_failback)
5c2e41
 		err = failback_listen();
5c2e41
 	pthread_cleanup_pop(1);
5c2e41
-- 
5c2e41
2.17.2
5c2e41