summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/omap-iommu.c
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2016-04-04 17:46:20 -0500
committerJoerg Roedel <jroedel@suse.de>2016-04-05 17:53:20 +0200
commit433c434a269e6a39753f0a97b4be903f96d030a9 (patch)
treedf095cd34a09c8512223f7cb18d7b63e850ab4a3 /drivers/iommu/omap-iommu.c
parent7c1ab60008755fc229b623a875f1e42de31cdb64 (diff)
downloadlinux-433c434a269e6a39753f0a97b4be903f96d030a9.tar.gz
linux-433c434a269e6a39753f0a97b4be903f96d030a9.tar.bz2
linux-433c434a269e6a39753f0a97b4be903f96d030a9.zip
iommu/omap: Use WARN_ON for page table alignment check
The OMAP IOMMU page table needs to be aligned on a 16K boundary, and the current code uses a BUG_ON on the alignment sanity check in the .domain_alloc() ops implementation. Replace this with a less severe WARN_ON and bail out gracefully. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu/omap-iommu.c')
-rw-r--r--drivers/iommu/omap-iommu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index f6cf728ee32a..e2583cce2cc1 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -1162,7 +1162,8 @@ static struct iommu_domain *omap_iommu_domain_alloc(unsigned type)
* should never fail, but please keep this around to ensure
* we keep the hardware happy
*/
- BUG_ON(!IS_ALIGNED((long)omap_domain->pgtable, IOPGD_TABLE_SIZE));
+ if (WARN_ON(!IS_ALIGNED((long)omap_domain->pgtable, IOPGD_TABLE_SIZE)))
+ goto fail_align;
clean_dcache_area(omap_domain->pgtable, IOPGD_TABLE_SIZE);
spin_lock_init(&omap_domain->lock);
@@ -1173,6 +1174,8 @@ static struct iommu_domain *omap_iommu_domain_alloc(unsigned type)
return &omap_domain->domain;
+fail_align:
+ kfree(omap_domain->pgtable);
fail_nomem:
kfree(omap_domain);
out: