[dm-devel] [PATCH] mpathpersist:check variable 'conf' before using it
tang.wenji at zte.com.cn
tang.wenji at zte.com.cn
Thu Nov 3 03:32:15 UTC 2016
From: "tang.wenji" <tang.wenji at zte.com.cn>
If the variable 'conf' is NULL, the program should exit.
Signed-off-by: tang.wenji <tang.wenji at zte.com.cn>
---
mpathpersist/main.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/mpathpersist/main.c b/mpathpersist/main.c
index 8e8cc35..5863082 100644
--- a/mpathpersist/main.c
+++ b/mpathpersist/main.c
@@ -105,6 +105,11 @@ int main (int argc, char * argv[])
udev = udev_new();
conf = mpath_lib_init(udev);
+ if(!conf) {
+ udev_unref(udev);
+ exit(1);
+ }
+
memset(transportids, 0, MPATH_MX_TIDS * sizeof(struct transportid));
multipath_conf = conf;
--
2.8.1.windows.1
More information about the dm-devel
mailing list