Skip to content

Commit be5a2d3

Browse files
Qinxin Xiawilldeacon
authored andcommitted
iommu/arm-smmu-v3: Fix incorrect return in arm_smmu_attach_dev
After commit 48e7b8e ("iommu/arm-smmu-v3: Remove arm_smmu_domain_finalise() during attach"), an error code is not returned on the attach path when the smmu does not match with the domain. This causes problems with VFIO because vfio_iommu_type1_attach_group() relies on this check to determine domain compatability. Re-instate the -EINVAL return value when the SMMU doesn't match on the device attach path. Fixes: 48e7b8e ("iommu/arm-smmu-v3: Remove arm_smmu_domain_finalise() during attach") Signed-off-by: Qinxin Xia <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent 8ffd015 commit be5a2d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2953,7 +2953,7 @@ static int arm_smmu_attach_dev(struct iommu_domain *domain, struct device *dev)
29532953
smmu = master->smmu;
29542954

29552955
if (smmu_domain->smmu != smmu)
2956-
return ret;
2956+
return -EINVAL;
29572957

29582958
if (smmu_domain->stage == ARM_SMMU_DOMAIN_S1) {
29592959
cdptr = arm_smmu_alloc_cd_ptr(master, IOMMU_NO_PASID);

0 commit comments

Comments
 (0)