Skip to content

Commit dc9de8a

Browse files
committed
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: 641fb0e ('iommu/of: Don't call iommu_ops->add_device directly') Reported-by: Marek Szyprowski <[email protected]> Reported-by: kernelci.org bot <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent d2e1a00 commit dc9de8a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/iommu/iommu.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,14 @@ void iommu_device_unregister(struct iommu_device *iommu)
114114
int iommu_probe_device(struct device *dev)
115115
{
116116
const struct iommu_ops *ops = dev->bus->iommu_ops;
117+
int ret = -EINVAL;
117118

118119
WARN_ON(dev->iommu_group);
119120

120-
return ops->add_device(dev);
121+
if (ops)
122+
ret = ops->add_device(dev);
123+
124+
return ret;
121125
}
122126

123127
void iommu_release_device(struct device *dev)

0 commit comments

Comments
 (0)