Blame SOURCES/open-iscsi-2.0.876-67-iscsiuio-fail-on-nic_nl_open-failing.patch

e88930
From 40c4319fd3100dcbf97880508c869978dff8f818 Mon Sep 17 00:00:00 2001
e88930
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
e88930
Date: Thu, 20 Sep 2018 07:37:01 +0200
e88930
Subject: [PATCH] iscsiuio: fail on nic_nl_open failing
e88930
e88930
The return value of nic_nl_open was ignored and while working by chance
e88930
being the latest call before the error label any later insertion of code
e88930
after this might break it.
e88930
e88930
Avoid that by checking for the retval and explicitly jumping to the
e88930
error label in case it is non zero.
e88930
e88930
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
e88930
---
e88930
 iscsiuio/src/unix/main.c | 3 ++-
e88930
 1 file changed, 2 insertions(+), 1 deletion(-)
e88930
e88930
diff --git a/iscsiuio/src/unix/main.c b/iscsiuio/src/unix/main.c
e88930
index 5cccc76ed220..552c96a36e86 100644
e88930
--- a/iscsiuio/src/unix/main.c
e88930
+++ b/iscsiuio/src/unix/main.c
e88930
@@ -393,7 +393,8 @@ int main(int argc, char *argv[])
e88930
 		goto error;
e88930
 
e88930
 	/*  NetLink connection to listen to NETLINK_ISCSI private messages */
e88930
-	nic_nl_open();
e88930
+	if (nic_nl_open() != 0)
e88930
+		goto error;
e88930
 
e88930
 error:
e88930
 	cleanup();
e88930
-- 
e88930
2.17.2
e88930