diff options
author | Yang Yingliang <yangyingliang@huawei.com> | 2020-11-26 16:38:25 +0300 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2020-11-26 17:53:32 +0300 |
commit | 058236eef606ea53ea7317afc20e9469cf3c3b91 (patch) | |
tree | cb5f66fe2501217de5520d989bfa6fac4430411f | |
parent | 6243f572a18db99607f29517b2d6b4209356b9fa (diff) | |
download | linux-058236eef606ea53ea7317afc20e9469cf3c3b91.tar.xz |
iommu: return error code when it can't get group
Although iommu_group_get() in iommu_probe_device() will always succeed
thanks to __iommu_probe_device() creating the group if it's not present,
it's still worth initialising 'ret' to -ENODEV in case this path is
reachable in the future.
For now, this patch results in no functional change.
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20201126133825.3643852-1-yangyingliang@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r-- | drivers/iommu/iommu.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 88b0c9192d8c..dd617ed854a3 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -253,8 +253,10 @@ int iommu_probe_device(struct device *dev) goto err_out; group = iommu_group_get(dev); - if (!group) + if (!group) { + ret = -ENODEV; goto err_release; + } /* * Try to allocate a default domain - needs support from the |