All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: "David S . Miller" <davem@davemloft.net>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org
Cc: linux-crypto@vger.kernel.org, Lokesh Vutla <lokeshvutla@ti.com>,
	Tero Kristo <kristo@kernel.org>
Subject: [PATCH 2/6] crypto: omap-sham - initialize req only after omap_sham_hw_init()
Date: Tue, 27 Jul 2021 13:23:35 +0300	[thread overview]
Message-ID: <20210727102339.49141-2-tony@atomide.com> (raw)
In-Reply-To: <20210727102339.49141-1-tony@atomide.com>

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>
---
 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

  reply	other threads:[~2021-07-27 10:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 10:23 [PATCH 1/6] crypto: omap-sham - clear dma flags only after omap_sham_update_dma_stop() Tony Lindgren
2021-07-27 10:23 ` Tony Lindgren [this message]
2021-07-27 10:23 ` [PATCH 3/6] crypto: omap-sham - add missing pm_runtime_dontuse_autosuspend() Tony Lindgren
2021-07-27 10:23 ` [PATCH 4/6] crypto: omap-sham - drop old hw_init and unused FLAGS_INIT Tony Lindgren
2021-07-27 10:23 ` [PATCH 5/6] crypto: omap-sham - drop suspend and resume functions Tony Lindgren
2021-07-27 10:23 ` [PATCH 6/6] crypto: omap-sham - drop pm_runtime_irqsafe() usage Tony Lindgren
2021-08-06 12:14 ` [PATCH 1/6] crypto: omap-sham - clear dma flags only after omap_sham_update_dma_stop() Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210727102339.49141-2-tony@atomide.com \
    --to=tony@atomide.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kristo@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=lokeshvutla@ti.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.