diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2021-08-20 15:49:49 +0800 |
---|---|---|
committer | Joerg Roedel <jroedel@suse.de> | 2021-08-20 14:35:09 +0200 |
commit | 53f613134984c293af158920ebadcac045fa0545 (patch) | |
tree | d7a23ee813973875d9fd32dab56edd21433a1c3f /drivers/iommu/arm | |
parent | af1d321c2e99f9d48d1b680ad0260a243bc7d40f (diff) | |
download | lwn-53f613134984c293af158920ebadcac045fa0545.tar.gz lwn-53f613134984c293af158920ebadcac045fa0545.zip |
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: b1a1347912a7 ("iommu/arm-smmu: Fix race condition during iommu_group creation")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Acked-by: Will Deacon <will@kernel.org>
Link: https://lore.kernel.org/r/20210820074949.1946576-1-yangyingliang@huawei.com
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/arm')
-rw-r--r-- | drivers/iommu/arm/arm-smmu/arm-smmu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index 67b660b0551d..45b4aedd7ab1 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -1488,8 +1488,10 @@ static struct iommu_group *arm_smmu_device_group(struct device *dev) mutex_lock(&smmu->stream_map_mutex); for_each_cfg_sme(cfg, fwspec, i, idx) { if (group && smmu->s2crs[idx].group && - group != smmu->s2crs[idx].group) + group != smmu->s2crs[idx].group) { + mutex_unlock(&smmu->stream_map_mutex); return ERR_PTR(-EINVAL); + } group = smmu->s2crs[idx].group; } |