[PATCH] dm: change kzalloc to kcalloc

Ethan Carter Edwards <[email protected]> Tue, 24 Dec 2024 22:13:21 +0000
Newsgroups com.openwall.lists.kernel-hardening,dev.linux.lists.dm-devel,org.kernel.vger.linux-hardening,org.kernel.vger.linux-kernel
Message-ID <Z7XWRfRi3Fn25wT4Dg19JRN4xrKcCt3TxaxZwsR_0LDR2C6fQxCiLrsMBfJg8f_ZqSAx3u6aPm-TR02dC6bLpMmqSI_jp_ADiJ_qW_27puk=@ethancedwards.com>
Use 2-factor multiplication argument form kcalloc() instead
of instead of the deprecated kzalloc() [1].

[1] https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded=
-arithmetic-in-allocator-arguments
Link: https://github.com/KSPP/linux/issues/162

Signed-off-by: Ethan Carter Edwards <[email protected]>
---
 drivers/md/dm-ps-io-affinity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/md/dm-ps-io-affinity.c b/drivers/md/dm-ps-io-affinity.=
c
index 461ee6b2044d..716807e511ee 100644
--- a/drivers/md/dm-ps-io-affinity.c
+++ b/drivers/md/dm-ps-io-affinity.c
@@ -116,7 +116,7 @@ static int ioa_create(struct path_selector *ps, unsigne=
d int argc, char **argv)
 =09if (!s)
 =09=09return -ENOMEM;
=20
-=09s->path_map =3D kzalloc(nr_cpu_ids * sizeof(struct path_info *),
+=09s->path_map =3D kcalloc(nr_cpu_ids, sizeof(struct path_info *),
 =09=09=09     GFP_KERNEL);
 =09if (!s->path_map)
 =09=09goto free_selector;
--=20
2.47.1