summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2021-07-27 13:23:35 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2021-08-06 19:45:23 +0800
commit6a1ec89f2c56da9c2bd0afedb48268dde086d729 (patch)
tree9c8694f2d939e439d9f8309790730dfd2f2bcc0f
parentfe28140b3393b0ba1eb95cc109f974a7e58b26fd (diff)
downloadlinux-6a1ec89f2c56da9c2bd0afedb48268dde086d729.tar.bz2
crypto: omap-sham - initialize req only after omap_sham_hw_init()
Let's only initialize dd->req after omap_sham_hw_init() in case of errors. Looks like leaving dd->req initialized on omap_sham_hw_init() errors is is not causing issues though as we return on errors. So this patch can be applied as clean-up. Cc: Lokesh Vutla <lokeshvutla@ti.com> Cc: Tero Kristo <kristo@kernel.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/omap-sham.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
index a47ac60a4ee1..c4411ad5788d 100644
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -1093,12 +1093,12 @@ static int omap_sham_hash_one_req(struct crypto_engine *engine, void *areq)
dev_dbg(dd->dev, "hash-one: op: %u, total: %u, digcnt: %zd, final: %d",
ctx->op, ctx->total, ctx->digcnt, final);
- dd->req = req;
-
err = omap_sham_hw_init(dd);
if (err)
return err;
+ dd->req = req;
+
if (ctx->digcnt)
dd->pdata->copy_hash(req, 0);