lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <469138c9-8faf-4a8d-b2fe-90d0718e2788@stanley.mountain>
Date: Thu, 15 Aug 2024 14:20:12 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Pavitrakumar M <pavitrakumarm@...avyalabs.com>
Cc: Herbert Xu <herbert@...dor.apana.org.au>,
	"David S. Miller" <davem@...emloft.net>,
	shwetar <shwetar@...avyalabs.com>,
	Ruud Derwig <Ruud.Derwig@...opsys.com>,
	linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/3] crypto: spacc - Fix NULL vs IS_ERR() check in
 spacc_aead_fallback()

The crypto_alloc_aead() function doesn't return NULL pointers, it returns
error pointers.  Fix the error checking.

Fixes: 06af76b46c78 ("crypto: spacc - Add SPAcc aead support")
Signed-off-by: Dan Carpenter <dan.carpenter@...aro.org>
---
 drivers/crypto/dwc-spacc/spacc_aead.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/crypto/dwc-spacc/spacc_aead.c b/drivers/crypto/dwc-spacc/spacc_aead.c
index 50ef9053fc4d..da9df329f9d4 100755
--- a/drivers/crypto/dwc-spacc/spacc_aead.c
+++ b/drivers/crypto/dwc-spacc/spacc_aead.c
@@ -784,9 +784,9 @@ static int spacc_aead_fallback(struct aead_request *req,
 	ctx->fb.aead = crypto_alloc_aead(aead_name, 0,
 					 CRYPTO_ALG_NEED_FALLBACK |
 					 CRYPTO_ALG_ASYNC);
-	if (!ctx->fb.aead) {
+	if (IS_ERR(ctx->fb.aead)) {
 		pr_err("Spacc aead fallback tfm is NULL!\n");
-		return -EINVAL;
+		return PTR_ERR(ctx->fb.aead);
 	}
 
 	subreq = aead_request_alloc(ctx->fb.aead, GFP_KERNEL);
-- 
2.43.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ