Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1676597 > unrolled thread

[PATCH 3/3] iommu: Warn once when device_group callback returns NULL

Started byJoerg Roedel <joro@8bytes.org>
First post2017-06-28 14:10 +0200
Last post2017-06-28 14:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 3/3] iommu: Warn once when device_group callback returns NULL Joerg Roedel <joro@8bytes.org> - 2017-06-28 14:10 +0200

#1676597 — [PATCH 3/3] iommu: Warn once when device_group callback returns NULL

FromJoerg Roedel <joro@8bytes.org>
Date2017-06-28 14:10 +0200
Subject[PATCH 3/3] iommu: Warn once when device_group callback returns NULL
Message-ID<tXjXc-6DX-3@gated-at.bofh.it>
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

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web