diff options
author | Alexander Couzens <lynxis@fe80.eu> | 2018-06-29 05:27:16 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-12-18 09:44:02 +0100 |
commit | c388a92d61af07957a79212e6cb274a96a576f0b (patch) | |
tree | 6ddce6747ebe318cac24684854ebcd8c059446ba /package/network/config | |
parent | 3b9bfe8328e071a33b9dad9fd92cd900697456f0 (diff) | |
download | upstream-c388a92d61af07957a79212e6cb274a96a576f0b.tar.gz upstream-c388a92d61af07957a79212e6cb274a96a576f0b.tar.bz2 upstream-c388a92d61af07957a79212e6cb274a96a576f0b.zip |
swconfig: fix un-initialized return value
Fix CID 1330844
Found-by: Coverity
Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
(backported from e37ad4e5ca2e70387656da81704ee4d4589c6d70)
Diffstat (limited to 'package/network/config')
-rw-r--r-- | package/network/config/swconfig/src/swlib.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/package/network/config/swconfig/src/swlib.c b/package/network/config/swconfig/src/swlib.c index e6e9aead47..0fb8ebb392 100644 --- a/package/network/config/swconfig/src/swlib.c +++ b/package/network/config/swconfig/src/swlib.c @@ -92,7 +92,7 @@ swlib_call(int cmd, int (*call)(struct nl_msg *, void *), struct nl_cb *cb = NULL; int finished; int flags = 0; - int err; + int err = 0; msg = nlmsg_alloc(); if (!msg) { @@ -105,7 +105,8 @@ swlib_call(int cmd, int (*call)(struct nl_msg *, void *), genlmsg_put(msg, NL_AUTO_PID, NL_AUTO_SEQ, genl_family_get_id(family), 0, flags, cmd, 0); if (data) { - if (data(msg, arg) < 0) + err = data(msg, arg); + if (err < 0) goto nla_put_failure; } |