summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuman Anna <s-anna@ti.com>2016-04-04 17:46:19 -0500
committerJoerg Roedel <jroedel@suse.de>2016-04-05 17:53:20 +0200
commit7c1ab60008755fc229b623a875f1e42de31cdb64 (patch)
tree1d9b7e7f5ea5e4d830018a074768d16252bab8eb
parent521f40823ebf2818045546d45aa378eba1c41717 (diff)
iommu/omap: Replace BUG() in iopgtable_store_entry_core()
The iopgtable_store_entry_core() function uses a BUG() statement for an unsupported page size entry programming. Replace this with a less severe WARN_ON() and perform a graceful bailout on error. Signed-off-by: Suman Anna <s-anna@ti.com> Signed-off-by: Joerg Roedel <jroedel@suse.de>
-rw-r--r--drivers/iommu/omap-iommu.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index c05d48f88596..f6cf728ee32a 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -628,10 +628,12 @@ iopgtable_store_entry_core(struct omap_iommu *obj, struct iotlb_entry *e)
break;
default:
fn = NULL;
- BUG();
break;
}
+ if (WARN_ON(!fn))
+ return -EINVAL;
+
prot = get_iopte_attr(e);
spin_lock(&obj->page_table_lock);