intel-iommu: Fix get_domain_for_dev() error path
commite77004d6125829cc856553e08fb2d5d2afb2e289
authorAlex Williamson <alex.williamson@redhat.com>
Fri, 4 Mar 2011 21:52:30 +0000 (4 14:52 -0700)
committerAndi Kleen <ak@linux.intel.com>
Thu, 28 Apr 2011 15:21:11 +0000 (28 08:21 -0700)
treed458c6471de3d1945464ed9925f522bf00860818
parent8e2f9d0be8626aca810c8cac38fce207ea81af4a
intel-iommu: Fix get_domain_for_dev() error path

commit 2fe9723df8e45fd247782adea244a5e653c30bf4 upstream.

If we run out of domain_ids and fail iommu_attach_domain(), we
fall into domain_exit() without having setup enough of the
domain structure for this to do anything useful.  In fact, it
typically runs off into the weeds walking the bogus domain->devices
list.  Just free the domain.

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>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
drivers/pci/intel-iommu.c