diff options
author | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2018-09-20 07:34:30 +0200 |
---|---|---|
committer | Christian Ehrhardt <christian.ehrhardt@canonical.com> | 2018-09-20 07:40:20 +0200 |
commit | 67d24cb06da6f9bc14dc5d9b833fad0e9ca1982f (patch) | |
tree | 4f60786dbd4c8e4b419fb8ce67a20e7e15ea35d8 /iscsiuio | |
parent | acd431211885d07eb9effe0d5b5f55a90d00cfbd (diff) | |
download | open-iscsi-67d24cb06da6f9bc14dc5d9b833fad0e9ca1982f.tar.gz |
iscsiuio: avoid loosing bad rc in nic_nl_open
nic_nl_open might have collected a non-zero rc and jumped to the error
label but still returned zero which would indicate success.
The function should return whatever it has collected in rc and while
working without, also explicitly initialize it to zero.
Fixes #125
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Diffstat (limited to 'iscsiuio')
-rw-r--r-- | iscsiuio/src/unix/nic_nl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/iscsiuio/src/unix/nic_nl.c b/iscsiuio/src/unix/nic_nl.c index 1a920c7..6588432 100644 --- a/iscsiuio/src/unix/nic_nl.c +++ b/iscsiuio/src/unix/nic_nl.c @@ -534,7 +534,7 @@ static void flush_nic_nl_process_ring(nic_t *nic) */ int nic_nl_open() { - int rc; + int rc = 0; char *msg_type_str; /* Prepare the thread to issue the ARP's */ @@ -676,5 +676,5 @@ int nic_nl_open() rc = 0; error: - return 0; + return rc; } |