[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210727102339.49141-2-tony@atomide.com>
Date: Tue, 27 Jul 2021 13:23:35 +0300
From: Tony Lindgren <tony@...mide.com>
To: "David S . Miller" <davem@...emloft.net>,
Herbert Xu <herbert@...dor.apana.org.au>,
linux-kernel@...r.kernel.org, linux-omap@...r.kernel.org
Cc: linux-crypto@...r.kernel.org, Lokesh Vutla <lokeshvutla@...com>,
Tero Kristo <kristo@...nel.org>
Subject: [PATCH 2/6] 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@...com>
Cc: Tero Kristo <kristo@...nel.org>
Signed-off-by: Tony Lindgren <tony@...mide.com>
---
drivers/crypto/omap-sham.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
--- 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);
--
2.32.0
Powered by blists - more mailing lists