[dm-devel] [PATCH v2 03/21] multipathd (coverity): terminate uxlsnr when polls allocation fails

mwilck at suse.com mwilck at suse.com
Wed Dec 1 12:36:32 UTC 2021


From: Martin Wilck <mwilck at suse.com>

The polls array is dereferenced later on, so even if we are soon
to be cancelled, we should return immediately here.

Reviewed-by: Benjamin Marzinski <bmarzins at redhat.com>
Signed-off-by: Martin Wilck <mwilck at suse.com>
---
 multipathd/uxlsnr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/multipathd/uxlsnr.c b/multipathd/uxlsnr.c
index cd025ea..912ac3c 100644
--- a/multipathd/uxlsnr.c
+++ b/multipathd/uxlsnr.c
@@ -609,6 +609,7 @@ void *uxsock_listen(long ux_sock, void *trigger_data)
 	if (!polls) {
 		condlog(0, "uxsock: failed to allocate poll fds");
 		exit_daemon();
+		return NULL;
 	}
 	notify_fd = inotify_init1(IN_NONBLOCK);
 	if (notify_fd == -1) /* it's fine if notifications fail */
-- 
2.33.1





More information about the dm-devel mailing list