diff options
author | Robin Murphy <robin.murphy@arm.com> | 2017-01-16 12:58:07 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-07-05 12:40:30 (GMT) |
commit | d7fcb303d1ee4416a6e4772735cfacc36e86bff7 (patch) | |
tree | 12c69acfff14e13638f7fad36d0cc0a0b2349581 /.cocciconfig | |
parent | c19bfc6765d44847a3880333474e2c992d63802f (diff) | |
download | linux-d7fcb303d1ee4416a6e4772735cfacc36e86bff7.tar.xz |
iommu: Handle default domain attach failure
commit 797a8b4d768c58caac58ee3e8cb36a164d1b7751 upstream.
We wouldn't normally expect ops->attach_dev() to fail, but on IOMMUs
with limited hardware resources, or generally misconfigured systems,
it is certainly possible. We report failure correctly from the external
iommu_attach_device() interface, but do not do so in iommu_group_add()
when attaching to the default domain. The result of failure there is
that the device, group and domain all get left in a broken,
part-configured state which leads to weird errors and misbehaviour down
the line when IOMMU API calls sort-of-but-don't-quite work.
Check the return value of __iommu_attach_device() on the default domain,
and refactor the error handling paths to cope with its failure and clean
up correctly in such cases.
Fixes: e39cb8a3aa98 ("iommu: Make sure a device is always attached to a domain")
Reported-by: Punit Agrawal <punit.agrawal@arm.com>
Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to '.cocciconfig')
0 files changed, 0 insertions, 0 deletions