Blame SOURCES/open-iscsi-2.0.876-66-iscsiuio-avoid-loosing-bad-rc-in-nic_nl_open.patch

47585c
From 67d24cb06da6f9bc14dc5d9b833fad0e9ca1982f Mon Sep 17 00:00:00 2001
47585c
From: Christian Ehrhardt <christian.ehrhardt@canonical.com>
47585c
Date: Thu, 20 Sep 2018 07:34:30 +0200
47585c
Subject: [PATCH] iscsiuio: avoid loosing bad rc in nic_nl_open
47585c
47585c
nic_nl_open might have collected a non-zero rc and jumped to the error
47585c
label but still returned zero which would indicate success.
47585c
47585c
The function should return whatever it has collected in rc and while
47585c
working without, also explicitly initialize it to zero.
47585c
47585c
Fixes #125
47585c
47585c
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
47585c
---
47585c
 iscsiuio/src/unix/nic_nl.c | 4 ++--
47585c
 1 file changed, 2 insertions(+), 2 deletions(-)
47585c
47585c
diff --git a/iscsiuio/src/unix/nic_nl.c b/iscsiuio/src/unix/nic_nl.c
47585c
index 1a920c7b63fe..658843236da8 100644
47585c
--- a/iscsiuio/src/unix/nic_nl.c
47585c
+++ b/iscsiuio/src/unix/nic_nl.c
47585c
@@ -534,7 +534,7 @@ static void flush_nic_nl_process_ring(nic_t *nic)
47585c
  */
47585c
 int nic_nl_open()
47585c
 {
47585c
-	int rc;
47585c
+	int rc = 0;
47585c
 	char *msg_type_str;
47585c
 
47585c
 	/* Prepare the thread to issue the ARP's */
47585c
@@ -676,5 +676,5 @@ int nic_nl_open()
47585c
 	rc = 0;
47585c
 
47585c
 error:
47585c
-	return 0;
47585c
+	return rc;
47585c
 }
47585c
-- 
47585c
2.17.2
47585c