crypto: ux500 - Fix kmap() bug
authorIra Weiny <ira.weiny@intel.com>
Tue, 11 Aug 2020 00:40:14 +0000 (17:40 -0700)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 21 Aug 2020 04:47:49 +0000 (14:47 +1000)
commit5d1cdfde11a5f0c9a21b8b2b085bac678e8a18b7
tree7f37db3e3fdb1d0408a83ce589e9f39cd761f7a4
parent3a61cdf43e670b99404436a5854aae993ef616ed
crypto: ux500 - Fix kmap() bug

Once the crypto hash walk is started by crypto_hash_walk_first()
returning non-zero, crypto_hash_walk_done() must be called to unmap any
memory which was mapped by *_walk_first().

Ensure crypto_hash_walk_done() is called properly by:

1) Re-arranging the check for device data to be prior to calling
   *_walk_first()
2) on error call crypto_hash_walk_done() with an error code to
   allow the hash walk code to clean up.

While we are at it clean up the 'out' label to be more meaningful.

Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/ux500/hash/hash_core.c