|
@@ -1090,7 +1090,8 @@ static int ipmmu_add_device(struct device *dev)
|
|
|
SZ_1G, SZ_2G);
|
|
|
if (IS_ERR(mapping)) {
|
|
|
dev_err(mmu->dev, "failed to create ARM IOMMU mapping\n");
|
|
|
- return PTR_ERR(mapping);
|
|
|
+ ret = PTR_ERR(mapping);
|
|
|
+ goto error;
|
|
|
}
|
|
|
|
|
|
mmu->mapping = mapping;
|
|
@@ -1106,6 +1107,7 @@ static int ipmmu_add_device(struct device *dev)
|
|
|
return 0;
|
|
|
|
|
|
error:
|
|
|
+ arm_iommu_release_mapping(mmu->mapping);
|
|
|
kfree(dev->archdata.iommu);
|
|
|
dev->archdata.iommu = NULL;
|
|
|
iommu_group_remove_device(dev);
|