Commit 72dcac63 authored by Joerg Roedel's avatar Joerg Roedel

iommu: Warn once when device_group callback returns NULL

This callback should never return NULL. Print a warning if
that happens so that we notice and can fix it.
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 8faf5e5a
...@@ -1010,6 +1010,9 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev) ...@@ -1010,6 +1010,9 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev)
if (ops && ops->device_group) if (ops && ops->device_group)
group = ops->device_group(dev); group = ops->device_group(dev);
if (WARN_ON_ONCE(group == NULL))
return ERR_PTR(-EINVAL);
if (IS_ERR(group)) if (IS_ERR(group))
return group; return group;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment