From: Joerg Roedel <joro@8bytes.org>
To: iommu@lists.linux-foundation.org
Cc: linux-kernel@vger.kernel.org,
Gerald Schaefer <gerald.schaefer@de.ibm.com>,
Suman Anna <s-anna@ti.com>, Joerg Roedel <jroedel@suse.de>
Subject: [PATCH 3/3] iommu: Warn once when device_group callback returns NULL
Date: Wed, 28 Jun 2017 14:00:58 +0200 [thread overview]
Message-ID: <1498651258-23700-3-git-send-email-joro@8bytes.org> (raw)
In-Reply-To: <1498651258-23700-1-git-send-email-joro@8bytes.org>
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
next prev parent reply other threads:[~2017-06-28 12:02 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-28 12:00 [PATCH 1/3] iommu: Return ERR_PTR() values from device_group call-backs Joerg Roedel
2017-06-28 12:00 ` [PATCH 2/3] iommu/omap: Return ERR_PTR in device_group call-back Joerg Roedel
2017-06-28 16:32 ` Suman Anna
2017-06-28 12:00 ` Joerg Roedel [this message]
2017-06-28 15:48 ` [PATCH 1/3] iommu: Return ERR_PTR() values from device_group call-backs Gerald Schaefer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1498651258-23700-3-git-send-email-joro@8bytes.org \
--to=joro@8bytes.org \
--cc=gerald.schaefer@de.ibm.com \
--cc=iommu@lists.linux-foundation.org \
--cc=jroedel@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=s-anna@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox