iommu/omap: Replace BUG() in iopgtable_store_entry_core()
authorSuman Anna <s-anna@ti.com>
Mon, 4 Apr 2016 22:46:19 +0000 (17:46 -0500)
committerJoerg Roedel <jroedel@suse.de>
Tue, 5 Apr 2016 15:53:20 +0000 (17:53 +0200)
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>
drivers/iommu/omap-iommu.c

index c05d48f..f6cf728 100644 (file)
@@ -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);