diff mbox series

[15/16] multipathd: fix broken pthread cleanup in fpin_fabric_notification_receiver()

Message ID 20220901160952.2167-16-mwilck@suse.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show
Series multipath-tools: minor fixes and build improvements | expand

Commit Message

Martin Wilck Sept. 1, 2022, 4:09 p.m. UTC
From: Martin Wilck <mwilck@suse.com>

We were returning from a phtread-cancel block. That should be avoided.

Signed-off-by: Martin Wilck <mwilck@suse.com>
---
 multipathd/fpin_handlers.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/multipathd/fpin_handlers.c b/multipathd/fpin_handlers.c
index a7da2c9..03b2b9a 100644
--- a/multipathd/fpin_handlers.c
+++ b/multipathd/fpin_handlers.c
@@ -499,13 +499,14 @@  void *fpin_fabric_notification_receiver(__attribute__((unused))void *unused)
 	rcu_register_thread();
 
 	pthread_cleanup_push(receiver_cleanup_list, NULL);
+	pthread_cleanup_push(cleanup_fd_ptr, &fd);
+
 	fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_SCSITRANSPORT);
 	if (fd < 0) {
 		condlog(0, "fc socket error %d", fd);
-		return NULL;
+		goto out;
 	}
 
-	pthread_cleanup_push(cleanup_fd_ptr, &fd);
 	memset(&fc_local, 0, sizeof(fc_local));
 	fc_local.nl_family = AF_NETLINK;
 	fc_local.nl_groups = ~0;