summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/ccp/ccp-crypto-sha.c
diff options
context:
space:
mode:
authorTom Lendacky <thomas.lendacky@amd.com>2014-01-06 13:34:23 -0600
committerHerbert Xu <herbert@gondor.apana.org.au>2014-01-15 11:33:40 +0800
commit82d1585b9a9d5106ec6a630696f3e2e532fc3cba (patch)
tree7d9afd48c678884bb88f98168098ea53aee57936 /drivers/crypto/ccp/ccp-crypto-sha.c
parent81a59f000e1d4a60a03081a1fc64aee46d6f0c3e (diff)
downloadtalos-op-linux-82d1585b9a9d5106ec6a630696f3e2e532fc3cba.tar.gz
talos-op-linux-82d1585b9a9d5106ec6a630696f3e2e532fc3cba.zip
crypto: ccp - Cleanup hash invocation calls
Cleanup the ahash digest invocations to check the init return code and make use of the finup routine. Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccp/ccp-crypto-sha.c')
-rw-r--r--drivers/crypto/ccp/ccp-crypto-sha.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/crypto/ccp/ccp-crypto-sha.c b/drivers/crypto/ccp/ccp-crypto-sha.c
index d30f6c893ffb..3867290b3531 100644
--- a/drivers/crypto/ccp/ccp-crypto-sha.c
+++ b/drivers/crypto/ccp/ccp-crypto-sha.c
@@ -248,9 +248,13 @@ static int ccp_sha_finup(struct ahash_request *req)
static int ccp_sha_digest(struct ahash_request *req)
{
- ccp_sha_init(req);
+ int ret;
- return ccp_do_sha_update(req, req->nbytes, 1);
+ ret = ccp_sha_init(req);
+ if (ret)
+ return ret;
+
+ return ccp_sha_finup(req);
}
static int ccp_sha_setkey(struct crypto_ahash *tfm, const u8 *key,
OpenPOWER on IntegriCloud