瀏覽代碼

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>
Suman Anna 9 年之前
父節點
當前提交
7c1ab60008
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      drivers/iommu/omap-iommu.c

+ 3 - 1
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);