Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1676597
| From | Joerg Roedel <joro@8bytes.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/3] iommu: Warn once when device_group callback returns NULL |
| Date | 2017-06-28 14:10 +0200 |
| Message-ID | <tXjXc-6DX-3@gated-at.bofh.it> (permalink) |
| References | <tXjXc-6DX-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Joerg Roedel <jroedel@suse.de> This callback should never return NULL. Print a warning if that happens so that we notice and can fix it. Signed-off-by: Joerg Roedel <jroedel@suse.de> --- drivers/iommu/iommu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index de09e1e..3f6ea16 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -1010,6 +1010,9 @@ struct iommu_group *iommu_group_get_for_dev(struct device *dev) if (ops && ops->device_group) group = ops->device_group(dev); + if (WARN_ON_ONCE(group == NULL)) + return ERR_PTR(-EINVAL); + if (IS_ERR(group)) return group; -- 2.7.4
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH 3/3] iommu: Warn once when device_group callback returns NULL Joerg Roedel <joro@8bytes.org> - 2017-06-28 14:10 +0200
csiph-web