Skip to content

Commit

Permalink
iommu: Check for iommu_ops == NULL in iommu_probe_device()
Browse files Browse the repository at this point in the history
This check needs to be there and got lost at some point
during development. Add it again.

Fixes: 641fb0e ('iommu/of: Don't call iommu_ops->add_device directly')
Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reported-by: kernelci.org bot <bot@kernelci.org>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
  • Loading branch information
Joerg Roedel committed Dec 20, 2018
1 parent d2e1a00 commit dc9de8a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/iommu/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dc9de8a

Please sign in to comment.