intel-iommu: Unlink domain from iommu
commit6a815cf43b27504d50e0153b6d60039c4558a429
authorAlex Williamson <alex.williamson@redhat.com>
Fri, 4 Mar 2011 21:52:16 +0000 (4 14:52 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 2 May 2011 16:19:35 +0000 (2 09:19 -0700)
tree99051c50c891cb964b0b802316d6f492029c0ee8
parent6a6a3e00ccd23f5b9d146a4b0591c8b61b4d0bb2
intel-iommu: Unlink domain from iommu

commit a97590e56d0d58e1dd262353f7cbd84e81d8e600 upstream.

When we remove a device, we unlink the iommu from the domain, but
we never do the reverse unlinking of the domain from the iommu.
This means that we never clear iommu->domain_ids, eventually leading
to resource exhaustion if we repeatedly bind and unbind a device
to a driver.  Also free empty domains to avoid a resource leak.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Acked-by: Donald Dutile <ddutile@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/pci/intel-iommu.c