From mboxrd@z Thu Jan 1 00:00:00 1970 From: jeffy.chen@rock-chips.com (Jeffy Chen) Date: Fri, 23 Mar 2018 15:38:02 +0800 Subject: [PATCH v8 02/14] iommu/rockchip: Fix error handling in probe In-Reply-To: <20180323073814.5802-1-jeffy.chen@rock-chips.com> References: <20180323073814.5802-1-jeffy.chen@rock-chips.com> Message-ID: <20180323073814.5802-3-jeffy.chen@rock-chips.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Add missing iommu_device_sysfs_remove in error path. Signed-off-by: Jeffy Chen Reviewed-by: Tomasz Figa Acked-by: Robin Murphy --- Changes in v8: Don't introduce the additional return. Changes in v7: None Changes in v6: None Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None drivers/iommu/rockchip-iommu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index e7fb824d123e..73117dbe839e 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -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; } -- 2.11.0