]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: ccp - avoid uninitialized variable warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 31 Jul 2017 20:49:21 +0000 (22:49 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Wed, 9 Aug 2017 12:17:58 +0000 (20:17 +0800)
commitc1faa0f4841585c5b1d525a2cf572291ae8ddf3f
tree46784a86859a79882f4f7fd764ae9cc0c108b081
parentdc9548be46878a1e7b713037ae91f60fc61873ec
crypto: ccp - avoid uninitialized variable warning

The added support for version 5 CCPs introduced a false-positive
warning in the RSA implementation:

drivers/crypto/ccp/ccp-ops.c: In function 'ccp_run_rsa_cmd':
drivers/crypto/ccp/ccp-ops.c:1856:3: error: 'sb_count' may be used uninitialized in this function [-Werror=maybe-uninitialized]

This changes the code in a way that should make it easier for
the compiler to track the state of the sb_count variable, and
avoid the warning.

Fixes: 189444c95cf3 ("crypto: ccp - Fix base RSA function for version 5 CCPs")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ccp/ccp-ops.c