mirror of https://github.com/torvalds/linux.git
crypto: hisilicon/qm - replace devm_kzalloc with devm_kcalloc
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>
This commit is contained in:
parent
f1fb16efe5
commit
7c234e138c
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue