]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: fix update of the uninitialized variable err
authorColin Ian King <colin.king@canonical.com>
Mon, 11 Nov 2019 12:33:34 +0000 (12:33 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 12 Nov 2019 06:04:03 +0000 (22:04 -0800)
commit7be906369f99cc615a94b137dd9797d4224b2384
tree39d40bd7abb0a6a8b2fec4a22d3a133d02d473bc
parentad029ff328016b371e9ebf8d04ed9691ca5756a8
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: 09a2b8a4df52 ("tipc: introduce TIPC encryption & authentication")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/crypto.c