]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitd46e37728b2ce26796f27c356c363486644ec32c
tree7f37db3e3fdb1d0408a83ce589e9f39cd761f7a4
parent82dde4f6846ac86fe9df21ff6fa324df55a74617
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