]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
crypto: omap-sham - initialize req only after omap_sham_hw_init()
authorTony Lindgren <tony@atomide.com>
Tue, 27 Jul 2021 10:23:35 +0000 (13:23 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 6 Aug 2021 11:45:23 +0000 (19:45 +0800)
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>
drivers/crypto/omap-sham.c

index a47ac60a4ee106285fb0a25e9fc3197e490a2873..c4411ad5788df2cb206610a16d99436f45b84734 100644 (file)
@@ -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);