@@ -1246,14 +1246,14 @@ static void __iommu_detach_group(struct iommu_domain *domain,
{
int ret;
- if (!group->default_domain) {
- __iommu_group_for_each_dev(group, domain,
- iommu_group_do_detach_device);
- group->domain = NULL;
+ if (group->domain == group->default_domain)
return;
- }
- if (group->domain == group->default_domain)
+ __iommu_group_for_each_dev(group, domain,
+ iommu_group_do_detach_device);
+ group->domain = NULL;
+
+ if (!group->default_domain)
return;
/* Detach by re-attaching to the default domain */
This patch ensures that all devices will be first detached from the provided domain and then attached to the default_domain if such has been provided. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> --- drivers/iommu/iommu.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)