iommu/rockchip: Fix error handling in probe
authorJeffy Chen <jeffy.chen@rock-chips.com>
Fri, 23 Mar 2018 07:38:02 +0000 (15:38 +0800)
committerJoerg Roedel <jroedel@suse.de>
Thu, 29 Mar 2018 10:22:22 +0000 (12:22 +0200)
Add missing iommu_device_sysfs_remove in error path.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-by: Tomasz Figa <tfiga@chromium.org>
Acked-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/rockchip-iommu.c

index e7fb824..73117db 100644 (file)
@@ -1193,6 +1193,8 @@ static int rk_iommu_probe(struct platform_device *pdev)
 
        iommu_device_set_ops(&iommu->iommu, &rk_iommu_ops);
        err = iommu_device_register(&iommu->iommu);
+       if (err)
+               iommu_device_sysfs_remove(&iommu->iommu);
 
        return err;
 }