]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
crypto: hisilicon/qm - replace devm_kzalloc with devm_kcalloc
authorEthan Carter Edwards <ethan@ethancedwards.com>
Sat, 3 May 2025 20:21:28 +0000 (16:21 -0400)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 5 May 2025 10:20:46 +0000 (18:20 +0800)
Replace devm_kzalloc that has an internal multiplication with
devm_kcalloc to improve code readability and safety from overflows.

Signed-off-by: Ethan Carter Edwards <ethan@ethancedwards.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/hisilicon/qm.c

index 80d57f0dbf26e2902e01103b0a705234009161ee..7c41f9593d039157ad900ee9fcc00e137d2ec169 100644 (file)
@@ -5224,7 +5224,7 @@ static int qm_pre_store_caps(struct hisi_qm *qm)
        size_t i, size;
 
        size = ARRAY_SIZE(qm_cap_query_info);
-       qm_cap = devm_kzalloc(&pdev->dev, sizeof(*qm_cap) * size, GFP_KERNEL);
+       qm_cap = devm_kcalloc(&pdev->dev, sizeof(*qm_cap), size, GFP_KERNEL);
        if (!qm_cap)
                return -ENOMEM;