summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
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 /drivers/iommu
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 'drivers/iommu')
-rw-r--r--drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h2
-rw-r--r--drivers/iommu/iommufd/device.c2
-rw-r--r--drivers/iommu/iommufd/driver.c2
-rw-r--r--drivers/iommu/iommufd/hwpt_noiommu.c2
-rw-r--r--drivers/iommu/vsi-iommu.c2
5 files changed, 5 insertions, 5 deletions
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
index 50f8321e9..dd2fee2f5 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h
@@ -796,7 +796,7 @@ static inline struct arm_smmu_invs *arm_smmu_invs_alloc(size_t num_invs)
{
struct arm_smmu_invs *new_invs;
- new_invs = kzalloc(struct_size(new_invs, inv, num_invs), GFP_KERNEL);
+ new_invs = kzalloc_flex(*new_invs, inv, num_invs);
if (!new_invs)
return NULL;
new_invs->max_invs = num_invs;
diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c
index 5c4b06eda..a664c70a6 100644
--- a/drivers/iommu/iommufd/device.c
+++ b/drivers/iommu/iommufd/device.c
@@ -76,7 +76,7 @@ static struct iommufd_group *iommufd_alloc_group(struct iommufd_ctx *ictx,
{
struct iommufd_group *new_igroup;
- new_igroup = kzalloc_obj(*new_igroup, GFP_KERNEL);
+ new_igroup = kzalloc_obj(*new_igroup);
if (!new_igroup)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/iommu/iommufd/driver.c b/drivers/iommu/iommufd/driver.c
index 3b8067976..e4d17a748 100644
--- a/drivers/iommu/iommufd/driver.c
+++ b/drivers/iommu/iommufd/driver.c
@@ -49,7 +49,7 @@ int _iommufd_alloc_mmap(struct iommufd_ctx *ictx, struct iommufd_object *owner,
if (!length || !PAGE_ALIGNED(length))
return -EINVAL;
- immap = kzalloc(sizeof(*immap), GFP_KERNEL);
+ immap = kzalloc_obj(*immap);
if (!immap)
return -ENOMEM;
immap->owner = owner;
diff --git a/drivers/iommu/iommufd/hwpt_noiommu.c b/drivers/iommu/iommufd/hwpt_noiommu.c
index 9b8b5eb71..a80209a74 100644
--- a/drivers/iommu/iommufd/hwpt_noiommu.c
+++ b/drivers/iommu/iommufd/hwpt_noiommu.c
@@ -54,7 +54,7 @@ noiommu_alloc_paging_flags(struct device *dev, u32 flags,
(BIT(PT_FEAT_DYNAMIC_TOP) | BIT(PT_FEAT_AMDV1_ENCRYPT_TABLES) |
BIT(PT_FEAT_AMDV1_FORCE_COHERENCE));
- dom = kzalloc(sizeof(*dom), GFP_KERNEL);
+ dom = kzalloc_obj(*dom);
if (!dom)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/iommu/vsi-iommu.c b/drivers/iommu/vsi-iommu.c
index 42c424496..5dac20b14 100644
--- a/drivers/iommu/vsi-iommu.c
+++ b/drivers/iommu/vsi-iommu.c
@@ -231,7 +231,7 @@ static struct iommu_domain *vsi_iommu_domain_alloc_paging(struct device *dev)
struct vsi_iommu *iommu = dev_iommu_priv_get(dev);
struct vsi_iommu_domain *vsi_domain;
- vsi_domain = kzalloc(sizeof(*vsi_domain), GFP_KERNEL);
+ vsi_domain = kzalloc_obj(*vsi_domain);
if (!vsi_domain)
return NULL;