提交 dc9de8a2 编写于 作者: J Joerg Roedel

iommu: Check for iommu_ops == NULL in iommu_probe_device()

This check needs to be there and got lost at some point
during development. Add it again.

Fixes: 641fb0ef ('iommu/of: Don't call iommu_ops->add_device directly')
Reported-by: NMarek Szyprowski <m.szyprowski@samsung.com>
Reported-by: Nkernelci.org bot <bot@kernelci.org>
Signed-off-by: NJoerg Roedel <jroedel@suse.de>
上级 d2e1a003
......@@ -114,10 +114,14 @@ void iommu_device_unregister(struct iommu_device *iommu)
int iommu_probe_device(struct device *dev)
{
const struct iommu_ops *ops = dev->bus->iommu_ops;
int ret = -EINVAL;
WARN_ON(dev->iommu_group);
return ops->add_device(dev);
if (ops)
ret = ops->add_device(dev);
return ret;
}
void iommu_release_device(struct device *dev)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册