]> www.infradead.org Git - users/willy/linux.git/commit
iommu/arm-smmu-v3: Improve add_device() error handling
authorJean-Philippe Brucker <jean-philippe@linaro.org>
Wed, 15 Jan 2020 12:52:37 +0000 (13:52 +0100)
committerWill Deacon <will@kernel.org>
Wed, 15 Jan 2020 16:30:27 +0000 (16:30 +0000)
commita2be6218e649fb6e444e468dae5d177eea64d328
tree13de5f28256236a3b3f76026a9cdc71ac5ca8f1b
parentd71e01716b3606a6648df7e5646ae12c75babde4
iommu/arm-smmu-v3: Improve add_device() error handling

Let add_device() clean up after itself. The iommu_bus_init() function
does call remove_device() on error, but other sites (e.g. of_iommu) do
not.

Don't free level-2 stream tables because we'd have to track if we
allocated each of them or if they are used by other endpoints. It's not
worth the hassle since they are managed resources.

Reviewed-by: Eric Auger <eric.auger@redhat.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jean-Philippe Brucker <jean-philippe@linaro.org>
Signed-off-by: Will Deacon <will@kernel.org>
drivers/iommu/arm-smmu-v3.c