aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Derrick <[email protected]>2019-12-31 13:24:19 -0700
committerJoerg Roedel <[email protected]>2020-01-07 17:08:57 +0100
commit7d4e6ccd1fb09dbfbc49746ca82bd5c25ad4bfe4 (patch)
tree292921f2a548dd438a5dc9e1fdf76ab982c87c8f
parent4a350a0ee5b0a14f826fcdf60dd1a3199cafbfd6 (diff)
iommu: Remove device link to group on failure
This adds the missing teardown step that removes the device link from the group when the device addition fails. Signed-off-by: Jon Derrick <[email protected]> Fixes: 797a8b4d768c5 ("iommu: Handle default domain attach failure") Reviewed-by: Lu Baolu <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
-rw-r--r--drivers/iommu/iommu.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index fdd40756dbc1..3ead597e1c57 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -751,6 +751,7 @@ err_put_group:
mutex_unlock(&group->mutex);
dev->iommu_group = NULL;
kobject_put(group->devices_kobj);
+ sysfs_remove_link(group->devices_kobj, device->name);
err_free_name:
kfree(device->name);
err_remove_link: