Commit 43376160 authored by Jon Derrick's avatar Jon Derrick Committed by Khalid Elmously

iommu: Remove device link to group on failure

BugLink: https://bugs.launchpad.net/bugs/1860681

commit 7d4e6ccd upstream.

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>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarConnor Kuehl <connor.kuehl@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent b43f9090
...@@ -447,6 +447,7 @@ int iommu_group_add_device(struct iommu_group *group, struct device *dev) ...@@ -447,6 +447,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