summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-09-05 20:45:18 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2026-09-05 20:45:18 -0700
commit1fc5a74b108fc90951890ec513ac81869f5eaff1 (patch)
treeddd247abac0e8e148e4ded357db093bee4fe35ed /arch
parent9f0346dcbea363787186c94ef94dd01aaa215afa (diff)
parent3a2c4d55e32ad65efebdb6de44eef3bfa08bb49d (diff)
downloadlinux-stable-1fc5a74b108fc90951890ec513ac81869f5eaff1.tar.gz
linux-stable-1fc5a74b108fc90951890ec513ac81869f5eaff1.zip
Merge tag 'kmalloc_obj-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull kmalloc_obj conversions from Kees Cook: "Another run of the Coccinelle script for converting kmalloc() family of allocations to kmalloc_obj() via the existing rules in scripts/coccinelle/api/kmalloc_objs.cocci" * tag 'kmalloc_obj-v7.3-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: treewide: refresh kmalloc_obj() conversions drm/amd/display: Fix harmless type mismatch in allocation
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/crypto/aes-neonbs-glue.c4
-rw-r--r--arch/arm64/kvm/nested.c2
-rw-r--r--arch/loongarch/kvm/intc/dmsintc.c2
-rw-r--r--arch/mips/bcm47xx/buttons.c8
-rw-r--r--arch/powerpc/sysdev/xive/common.c2
-rw-r--r--arch/riscv/kvm/vcpu_pmu.c4
-rw-r--r--arch/s390/kvm/s390/s390.c4
7 files changed, 13 insertions, 13 deletions
diff --git a/arch/arm64/crypto/aes-neonbs-glue.c b/arch/arm64/crypto/aes-neonbs-glue.c
index 5bcbac979..7cb1aede9 100644
--- a/arch/arm64/crypto/aes-neonbs-glue.c
+++ b/arch/arm64/crypto/aes-neonbs-glue.c
@@ -66,7 +66,7 @@ static int aesbs_setkey(struct crypto_skcipher *tfm, const u8 *in_key,
struct crypto_aes_ctx *rk;
int err;
- rk = kmalloc(sizeof(*rk), GFP_KERNEL);
+ rk = kmalloc_obj(*rk);
if (!rk)
return -ENOMEM;
@@ -128,7 +128,7 @@ static int aesbs_cbc_ctr_setkey(struct crypto_skcipher *tfm, const u8 *in_key,
struct crypto_aes_ctx *rk;
int err;
- rk = kmalloc(sizeof(*rk), GFP_KERNEL);
+ rk = kmalloc_obj(*rk);
if (!rk)
return -ENOMEM;
diff --git a/arch/arm64/kvm/nested.c b/arch/arm64/kvm/nested.c
index 17123f0b6..3c4fc566e 100644
--- a/arch/arm64/kvm/nested.c
+++ b/arch/arm64/kvm/nested.c
@@ -93,7 +93,7 @@ int kvm_vcpu_init_nested(struct kvm_vcpu *vcpu)
num_mmus = atomic_read(&kvm->online_vcpus) * S2_MMU_PER_VCPU;
if (num_mmus > kvm->arch.nested_mmus_size) {
- tmp = kvcalloc(num_mmus, sizeof(*tmp), GFP_KERNEL_ACCOUNT);
+ tmp = kvzalloc_objs(*tmp, num_mmus, GFP_KERNEL_ACCOUNT);
if (!tmp)
return -ENOMEM;
diff --git a/arch/loongarch/kvm/intc/dmsintc.c b/arch/loongarch/kvm/intc/dmsintc.c
index c7d8841df..89f980d86 100644
--- a/arch/loongarch/kvm/intc/dmsintc.c
+++ b/arch/loongarch/kvm/intc/dmsintc.c
@@ -149,7 +149,7 @@ static int kvm_dmsintc_create(struct kvm_device *dev, u32 type)
return -EINVAL;
}
- s = kzalloc(sizeof(struct loongarch_dmsintc), GFP_KERNEL);
+ s = kzalloc_obj(struct loongarch_dmsintc);
if (!s)
return -ENOMEM;
diff --git a/arch/mips/bcm47xx/buttons.c b/arch/mips/bcm47xx/buttons.c
index 151a4ee28..7bb338da8 100644
--- a/arch/mips/bcm47xx/buttons.c
+++ b/arch/mips/bcm47xx/buttons.c
@@ -523,24 +523,24 @@ bcm47xx_buttons_add(const struct bcm47xx_gpio_key *buttons, int nbuttons)
/* 1 node for gpio-keys device, 1 node for each button, 1 terminator */
const struct software_node **node_group __free(kfree) =
- kcalloc(1 + nbuttons + 1, sizeof(*node_group), GFP_KERNEL);
+ kzalloc_objs(*node_group, 1 + nbuttons + 1);
if (!node_group)
return -ENOMEM;
/* 1 code property, 1 gpio property, 1 terminator */
struct property_entry *props __free(kfree) =
- kcalloc(nbuttons * 3, sizeof(*props), GFP_KERNEL);
+ kzalloc_objs(*props, nbuttons * 3);
if (!props)
return -ENOMEM;
/* 1 node for gpio-keys device, 1 node for each button */
struct software_node *nodes __free(kfree) =
- kcalloc(1 + nbuttons, sizeof(*nodes), GFP_KERNEL);
+ kzalloc_objs(*nodes, 1 + nbuttons);
if (!nodes)
return -ENOMEM;
struct software_node_ref_args *ref_args __free(kfree) =
- kcalloc(nbuttons, sizeof(*ref_args), GFP_KERNEL);
+ kzalloc_objs(*ref_args, nbuttons);
if (!ref_args)
return -ENOMEM;
diff --git a/arch/powerpc/sysdev/xive/common.c b/arch/powerpc/sysdev/xive/common.c
index 8ae088632..ed3d3e26c 100644
--- a/arch/powerpc/sysdev/xive/common.c
+++ b/arch/powerpc/sysdev/xive/common.c
@@ -1134,7 +1134,7 @@ static int __init xive_init_ipis(void)
if (!ipi_domain)
goto out_free_fwnode;
- xive_ipis = kzalloc_objs(*xive_ipis, nr_node_ids, GFP_KERNEL);
+ xive_ipis = kzalloc_objs(*xive_ipis, nr_node_ids);
if (!xive_ipis)
goto out_free_domain;
diff --git a/arch/riscv/kvm/vcpu_pmu.c b/arch/riscv/kvm/vcpu_pmu.c
index 752f1014d..6ff741ee7 100644
--- a/arch/riscv/kvm/vcpu_pmu.c
+++ b/arch/riscv/kvm/vcpu_pmu.c
@@ -503,8 +503,8 @@ int kvm_riscv_vcpu_pmu_event_info(struct kvm_vcpu *vcpu, unsigned long saddr_low
}
}
- einfo = kvcalloc(num_events, sizeof(*einfo),
- GFP_KERNEL_ACCOUNT | __GFP_NOWARN);
+ einfo = kvzalloc_objs(*einfo, num_events,
+ GFP_KERNEL_ACCOUNT | __GFP_NOWARN);
if (!einfo) {
ret = SBI_ERR_FAILURE;
goto out;
diff --git a/arch/s390/kvm/s390/s390.c b/arch/s390/kvm/s390/s390.c
index b0839e887..5c73f4378 100644
--- a/arch/s390/kvm/s390/s390.c
+++ b/arch/s390/kvm/s390/s390.c
@@ -2168,7 +2168,7 @@ static int kvm_s390_get_skeys(struct kvm *kvm, struct kvm_s390_skeys *args)
if (args->count < 1 || args->count > KVM_S390_SKEYS_MAX)
return -EINVAL;
- keys = kvmalloc_array(args->count, sizeof(*keys), GFP_KERNEL_ACCOUNT);
+ keys = kvmalloc_objs(*keys, args->count, GFP_KERNEL_ACCOUNT);
if (!keys)
return -ENOMEM;
@@ -2205,7 +2205,7 @@ static int kvm_s390_set_skeys(struct kvm *kvm, struct kvm_s390_skeys *args)
if (args->count < 1 || args->count > KVM_S390_SKEYS_MAX)
return -EINVAL;
- keys = kvmalloc_array(args->count, sizeof(*keys), GFP_KERNEL_ACCOUNT);
+ keys = kvmalloc_objs(*keys, args->count, GFP_KERNEL_ACCOUNT);
if (!keys)
return -ENOMEM;