Skip to content

Commit 53f6131

Browse files
Yang Yingliangjoergroedel
authored andcommitted
iommu/arm-smmu: Fix missing unlock on error in arm_smmu_device_group()
Add the missing unlock before return from function arm_smmu_device_group() in the error handling case. Fixes: b1a1347 ("iommu/arm-smmu: Fix race condition during iommu_group creation") Reported-by: Hulk Robot <[email protected]> Signed-off-by: Yang Yingliang <[email protected]> Acked-by: Will Deacon <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Joerg Roedel <[email protected]>
1 parent af1d321 commit 53f6131

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,8 +1488,10 @@ static struct iommu_group *arm_smmu_device_group(struct device *dev)
14881488
mutex_lock(&smmu->stream_map_mutex);
14891489
for_each_cfg_sme(cfg, fwspec, i, idx) {
14901490
if (group && smmu->s2crs[idx].group &&
1491-
group != smmu->s2crs[idx].group)
1491+
group != smmu->s2crs[idx].group) {
1492+
mutex_unlock(&smmu->stream_map_mutex);
14921493
return ERR_PTR(-EINVAL);
1494+
}
14931495

14941496
group = smmu->s2crs[idx].group;
14951497
}

0 commit comments

Comments
 (0)