iommu/vt-d: Unlink device if failed to add to group
authorJon Derrick <jonathan.derrick@intel.com>
Tue, 31 Dec 2019 20:24:20 +0000 (13:24 -0700)
committerJoerg Roedel <jroedel@suse.de>
Tue, 7 Jan 2020 16:08:57 +0000 (17:08 +0100)
commitf78947c409204138a4bc0609f98e07ef9d01ac0a
treec2c30f368fedb6891a1f6b8282a6637cba81c31f
parent7d4e6ccd1fb09dbfbc49746ca82bd5c25ad4bfe4
iommu/vt-d: Unlink device if failed to add to group

If the device fails to be added to the group, make sure to unlink the
reference before returning.

Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
Fixes: 39ab9555c2411 ("iommu: Add sysfs bindings for struct iommu_device")
Acked-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
drivers/iommu/intel-iommu.c