Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp4276980pxv; Tue, 27 Jul 2021 03:25:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIx9pzxtI5OD7RGGn0G73cjp/GCJfRURVLu34M1Usa5eODDbGe5ylbxg+zg5YJdhDZMlZp X-Received: by 2002:a17:906:c30f:: with SMTP id s15mr11586745ejz.233.1627381519535; Tue, 27 Jul 2021 03:25:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627381519; cv=none; d=google.com; s=arc-20160816; b=e2pF2WdTmDbD5trKkV4q5NNaQLUp3oJ5fZfS4zw8s5OWXB3aV0cfYVqMwD8TY6CPYv d730nF+YlSfEXzeUyD2YVlgOLxvrpoAkVSgcay2DbylR6DQUwNBmmbn5v2mIGZG+fypA 7TGFaizWqCL5/wyPiWIZ+JUSVfoPDhHSBJMKiZltU++8ZfbDUkUNGumdaSLqWS4RMHaO skNrHY8omFyj8BPiw89qEolIoWrkfTjfBiHP5MM2TekImOjzGBwTRhjVb71IcOSMxa9+ nfOVa7T7oEaO4DPiFYrMKhC6rIX/KjnMqw4r3h/vPU2/fXNLjeOZzVRTfPNJD62DHG4v V/AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=clqHzJ6+dpd4AC2urRHN6G2iCOUt5q2/kxKND3vsu9E=; b=XGv15gFuvOL02Z+0iBxpuKmzPt/fuZ8EpSQ2JYL4vrxUl1IyBWQt/QFq5QoyL2UET7 2HxfsgJyGjTqtgOzBeRTMz+PLcuzocvnZxqrHQ9jc8MSGmO28YDqnuM4n2J3qfd6muWB AuyV96cMgWD4YMlaPd5hDJPyQ5jNBV/I5nyqhGhoTNFArADfnjiCRNoEFLdjD9kiSxii mNMQL2aIsCQ2He1W3ViIAfe4v4q+d2QTy5n2NCmWbUhqK8mMhauNwvlBSSQVeq+kEYMH vHIxGwaN1od6pXInHHUxMeoa5I0/joC2iqYqOX9zXEx2xXPROZWbyjhfmXu6wR+PvsVv A49A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k13si2334641eja.474.2021.07.27.03.24.56; Tue, 27 Jul 2021 03:25:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236103AbhG0KX7 (ORCPT + 99 others); Tue, 27 Jul 2021 06:23:59 -0400 Received: from muru.com ([72.249.23.125]:55814 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236186AbhG0KXv (ORCPT ); Tue, 27 Jul 2021 06:23:51 -0400 Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 5F2208106; Tue, 27 Jul 2021 10:24:08 +0000 (UTC) From: Tony Lindgren To: "David S . Miller" , Herbert Xu , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Cc: linux-crypto@vger.kernel.org, Lokesh Vutla , Tero Kristo Subject: [PATCH 2/6] crypto: omap-sham - initialize req only after omap_sham_hw_init() Date: Tue, 27 Jul 2021 13:23:35 +0300 Message-Id: <20210727102339.49141-2-tony@atomide.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210727102339.49141-1-tony@atomide.com> References: <20210727102339.49141-1-tony@atomide.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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 Cc: Tero Kristo Signed-off-by: Tony Lindgren --- 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