summaryrefslogtreecommitdiff
path: root/iscsiuio
diff options
context:
space:
mode:
authorChristian Ehrhardt <christian.ehrhardt@canonical.com>2018-09-20 07:37:01 +0200
committerChristian Ehrhardt <christian.ehrhardt@canonical.com>2018-09-20 07:40:20 +0200
commit40c4319fd3100dcbf97880508c869978dff8f818 (patch)
tree3c2426d328b83916cdcc87fbb73b25dddbbc21a7 /iscsiuio
parent67d24cb06da6f9bc14dc5d9b833fad0e9ca1982f (diff)
downloadopen-iscsi-40c4319fd3100dcbf97880508c869978dff8f818.tar.gz
iscsiuio: fail on nic_nl_open failing
The return value of nic_nl_open was ignored and while working by chance being the latest call before the error label any later insertion of code after this might break it. Avoid that by checking for the retval and explicitly jumping to the error label in case it is non zero. Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'iscsiuio')
-rw-r--r--iscsiuio/src/unix/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/iscsiuio/src/unix/main.c b/iscsiuio/src/unix/main.c
index 5cccc76..552c96a 100644
--- a/iscsiuio/src/unix/main.c
+++ b/iscsiuio/src/unix/main.c
@@ -393,7 +393,8 @@ int main(int argc, char *argv[])
goto error;
/* NetLink connection to listen to NETLINK_ISCSI private messages */
- nic_nl_open();
+ if (nic_nl_open() != 0)
+ goto error;
error:
cleanup();