On Fri, Aug 20, 2021 at 03:49:49PM +0800, Yang Yingliang wrote:
> 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 <hul...@huawei.com>
> Signed-off-by: Yang Yingliang <yangyingli...@huawei.com>
> ---
>  drivers/iommu/arm/arm-smmu/arm-smmu.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c 
> b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> index 73893180ec7e..4bc75c4ce402 100644
> --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> @@ -1478,8 +1478,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);
> +             }

Urgh, I should really have spotted that in review. Thanks:

Acked-by: Will Deacon <w...@kernel.org>

Joerg -- please can you throw this on top?

Will
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to