summaryrefslogtreecommitdiff
path: root/net/tipc/crypto.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-11-11 12:33:34 +0000
committerDavid S. Miller <davem@davemloft.net>2019-11-11 22:04:03 -0800
commitc33fdc3453313137f8740a227525ed518bc68e28 (patch)
tree39d40bd7abb0a6a8b2fec4a22d3a133d02d473bc /net/tipc/crypto.c
parent59618bc0e3949f9907ca236761bfca4ba39700e6 (diff)
tipc: fix update of the uninitialized variable err
Variable err is not uninitialized and hence can potentially contain any garbage value. This may cause an error when logical or'ing the return values from the calls to functions crypto_aead_setauthsize or crypto_aead_setkey. Fix this by setting err to the return of crypto_aead_setauthsize rather than or'ing in the return into the uninitialized variable Addresses-Coverity: ("Uninitialized scalar variable") Fixes: fc1b6d6de220 ("tipc: introduce TIPC encryption & authentication") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc/crypto.c')
-rw-r--r--net/tipc/crypto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c
index 05f7ca76e8ce..990a872cec46 100644
--- a/net/tipc/crypto.c
+++ b/net/tipc/crypto.c
@@ -463,7 +463,7 @@ static int tipc_aead_init(struct tipc_aead **aead, struct tipc_aead_key *ukey,
break;
}
- err |= crypto_aead_setauthsize(tfm, TIPC_AES_GCM_TAG_SIZE);
+ err = crypto_aead_setauthsize(tfm, TIPC_AES_GCM_TAG_SIZE);
err |= crypto_aead_setkey(tfm, ukey->key, keylen);
if (unlikely(err)) {
crypto_free_aead(tfm);