]> git.ipfire.org Git - people/arne_f/kernel.git/commit
iommu: Check return of __iommu_attach_device()
authorShameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Thu, 19 Nov 2020 16:58:46 +0000 (16:58 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Dec 2020 07:51:56 +0000 (08:51 +0100)
commita63d225aca5d51e419d6443f9b25b36ab710e006
tree33661ef2a65f5b147b26ef2d4a557f7af7d7662a
parenta14257e43b909a95f814abeef3a22233aae7a297
iommu: Check return of __iommu_attach_device()

[ Upstream commit 77c38c8cf52ef715bfc5cab3d14222d4f3e776e2 ]

Currently iommu_create_device_direct_mappings() is called
without checking the return of __iommu_attach_device(). This
may result in failures in iommu driver if dev attach returns
error.

Fixes: ce574c27ae27 ("iommu: Move iommu_group_create_direct_mappings() out of iommu_group_add_device()")
Signed-off-by: Shameer Kolothum <shameerali.kolothum.thodi@huawei.com>
Link: https://lore.kernel.org/r/20201119165846.34180-1-shameerali.kolothum.thodi@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/iommu/iommu.c