summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64bb39c)
raw | patch | inline | side by side (parent: 64bb39c)
author | Suman Anna <s-anna@ti.com> | |
Tue, 30 Sep 2014 23:11:15 +0000 (18:11 -0500) | ||
committer | Suman Anna <s-anna@ti.com> | |
Thu, 2 Oct 2014 16:39:00 +0000 (11:39 -0500) |
Commit a894073 (iommu/omap: check for valid archdata in attach_dev)
has added a sanity check to make sure that the archdata is valid in
attach_dev. Revise this check to also check for the name field, which
would be set correctly only fir properly configured client devices.
The check is also moved outside of the locking primitive.
This revision syncs up this check with the code in upstream vanilla
kernel.
Signed-off-by: Suman Anna <s-anna@ti.com>
has added a sanity check to make sure that the archdata is valid in
attach_dev. Revise this check to also check for the name field, which
would be set correctly only fir properly configured client devices.
The check is also moved outside of the locking primitive.
This revision syncs up this check with the code in upstream vanilla
kernel.
Signed-off-by: Suman Anna <s-anna@ti.com>
drivers/iommu/omap-iommu.c | patch | blob | history |
index 1e3969447a598f04394a6d6a644077fedf5c6f18..9c13340e09d1eb97585f75f57dea7ad4e2615b34 100644 (file)
int ret = 0;
int i;
- spin_lock(&omap_domain->lock);
-
- if (!arch_data) {
+ if (!arch_data || !arch_data->name) {
dev_err(dev, "device doesn't have an associated iommu\n");
- ret = -EINVAL;
- goto out;
+ return -EINVAL;
}
+ spin_lock(&omap_domain->lock);
+
/* only a single client device can be attached to a domain */
if (omap_domain->attached) {
dev_err(dev, "iommu domain is already attached\n");