Re: [RFC 1/5] iommu: Remove device link to group on failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.lu@xxxxxxxxxxxxxxx>

Best regards,
baolu


Signed-off-by: Jon Derrick <jonathan.derrick@xxxxxxxxx>
---
  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:




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux