Hi,

On 1/1/20 4:24 AM, Jon Derrick wrote:
This adds the missing teardown step that removes the device link from
the group when the device addition fails.

This change looks good to me.

Reviewed-by: Lu Baolu <baolu...@linux.intel.com>

Best regards,
baolu


Signed-off-by: Jon Derrick <jonathan.derr...@intel.com>
---
  drivers/iommu/iommu.c | 1 +
  1 file changed, 1 insertion(+)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index d5174f0..3e35284 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -768,6 +768,7 @@ int iommu_group_add_device(struct iommu_group *group, 
struct device *dev)
        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:

_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to