Commit 7d4e6ccd authored by Jon Derrick's avatar Jon Derrick Committed by Joerg Roedel

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: default avatarJon Derrick <jonathan.derrick@intel.com>
Fixes: 797a8b4d ("iommu: Handle default domain attach failure")
Reviewed-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 4a350a0e
...@@ -751,6 +751,7 @@ int iommu_group_add_device(struct iommu_group *group, struct device *dev) ...@@ -751,6 +751,7 @@ int iommu_group_add_device(struct iommu_group *group, struct device *dev)
mutex_unlock(&group->mutex); mutex_unlock(&group->mutex);
dev->iommu_group = NULL; dev->iommu_group = NULL;
kobject_put(group->devices_kobj); kobject_put(group->devices_kobj);
sysfs_remove_link(group->devices_kobj, device->name);
err_free_name: err_free_name:
kfree(device->name); kfree(device->name);
err_remove_link: err_remove_link:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment