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

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