From patchwork Mon Apr 4 22:46:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suman Anna X-Patchwork-Id: 65034 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp137568lbc; Mon, 4 Apr 2016 15:46:44 -0700 (PDT) X-Received: by 10.66.235.9 with SMTP id ui9mr57055337pac.135.1459809996537; Mon, 04 Apr 2016 15:46:36 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5si3172033pat.66.2016.04.04.15.46.36; Mon, 04 Apr 2016 15:46:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755774AbcDDWqg (ORCPT + 3 others); Mon, 4 Apr 2016 18:46:36 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:40166 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755579AbcDDWqf (ORCPT ); Mon, 4 Apr 2016 18:46:35 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id u34MkO8A031750; Mon, 4 Apr 2016 17:46:24 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u34MkOVn021060; Mon, 4 Apr 2016 17:46:24 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.224.2; Mon, 4 Apr 2016 17:46:23 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id u34MkNJ7025082; Mon, 4 Apr 2016 17:46:23 -0500 Received: from localhost (irmo.am.dhcp.ti.com [128.247.83.68]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id u34MkN910405; Mon, 4 Apr 2016 17:46:23 -0500 (CDT) From: Suman Anna To: Joerg Roedel CC: , , Suman Anna Subject: [PATCH 2/4] iommu/omap: Replace BUG() in iopgtable_store_entry_core() Date: Mon, 4 Apr 2016 17:46:19 -0500 Message-ID: <1459809981-37984-3-git-send-email-s-anna@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1459809981-37984-1-git-send-email-s-anna@ti.com> References: <1459809981-37984-1-git-send-email-s-anna@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org 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 --- drivers/iommu/omap-iommu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);