Blame SOURCES/0002-multipathd-check-for-NULL-udevice-in-cli_add_path.patch

5c2e41
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
5c2e41
From: Benjamin Marzinski <bmarzins@redhat.com>
5c2e41
Date: Fri, 5 Oct 2018 17:20:38 -0500
5c2e41
Subject: [PATCH] multipathd: check for NULL udevice in cli_add_path
5c2e41
5c2e41
If cli_add_path can't get a udevice for the path, it should fail,
5c2e41
instead of continuing with a NULL udevice.
5c2e41
5c2e41
Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
5c2e41
---
5c2e41
 multipathd/cli_handlers.c | 4 ++++
5c2e41
 1 file changed, 4 insertions(+)
5c2e41
5c2e41
diff --git a/multipathd/cli_handlers.c b/multipathd/cli_handlers.c
5c2e41
index bb16472..7500080 100644
5c2e41
--- a/multipathd/cli_handlers.c
5c2e41
+++ b/multipathd/cli_handlers.c
5c2e41
@@ -720,6 +720,10 @@ cli_add_path (void * v, char ** reply, int * len, void * data)
5c2e41
 		udevice = udev_device_new_from_subsystem_sysname(udev,
5c2e41
 								 "block",
5c2e41
 								 param);
5c2e41
+		if (!udevice) {
5c2e41
+			condlog(0, "%s: can't find path", param);
5c2e41
+			return 1;
5c2e41
+		}
5c2e41
 		conf = get_multipath_config();
5c2e41
 		pthread_cleanup_push(put_multipath_config, conf);
5c2e41
 		r = store_pathinfo(vecs->pathvec, conf,
5c2e41
-- 
5c2e41
2.7.4
5c2e41