[PATCH master 3/5] crypto: caam - pbl-init: fix null pointer check

Ahmad Fatoum a.fatoum at pengutronix.de
Tue Mar 7 02:14:44 PST 2023


struct jr_data_st::desc is an array, so g_jrdata->desc will never be
NULL. Fix the check to instead compare g_jrdata against NULL.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 drivers/crypto/caam/pbl-init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/crypto/caam/pbl-init.c b/drivers/crypto/caam/pbl-init.c
index 3bc6cfaaeea1..08fad4525a21 100644
--- a/drivers/crypto/caam/pbl-init.c
+++ b/drivers/crypto/caam/pbl-init.c
@@ -331,7 +331,7 @@ static int do_instantiation(struct caam_job_ring __iomem *jr,
 	u32 ent_delay;
 	u32 status;
 
-	if (!g_jrdata->desc) {
+	if (!g_jrdata) {
 		pr_err("descriptor allocation failed\n");
 		return -ENODEV;
 	}
-- 
2.30.2




More information about the barebox mailing list