From patchwork Thu Apr 2 06:33:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tang Bin X-Patchwork-Id: 11470135 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 72E0592A for ; Thu, 2 Apr 2020 06:31:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 59DB42063A for ; Thu, 2 Apr 2020 06:31:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728585AbgDBGbv (ORCPT ); Thu, 2 Apr 2020 02:31:51 -0400 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:3989 "EHLO cmccmta2.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728455AbgDBGbv (ORCPT ); Thu, 2 Apr 2020 02:31:51 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.13]) by rmmx-syy-dmz-app05-12005 (RichMail) with SMTP id 2ee55e8586c69ff-55a97; Thu, 02 Apr 2020 14:31:35 +0800 (CST) X-RM-TRANSID: 2ee55e8586c69ff-55a97 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[112.25.154.146]) by rmsmtp-syy-appsvr07-12007 (RichMail) with SMTP id 2ee75e8586c5e97-90b06; Thu, 02 Apr 2020 14:31:35 +0800 (CST) X-RM-TRANSID: 2ee75e8586c5e97-90b06 From: Tang Bin To: agross@kernel.org, bjorn.andersson@linaro.org, robdclark@gmail.com Cc: joro@8bytes.org, linux-arm-msm@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Tang Bin Subject: [PATCH] iommu/qcom:fix local_base status check Date: Thu, 2 Apr 2020 14:33:02 +0800 Message-Id: <20200402063302.20640-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Release resources when exiting on error. Signed-off-by: Tang Bin Reviewed-by: Bjorn Andersson --- drivers/iommu/qcom_iommu.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/qcom_iommu.c b/drivers/iommu/qcom_iommu.c index 4328da0b0..c08aa9651 100644 --- a/drivers/iommu/qcom_iommu.c +++ b/drivers/iommu/qcom_iommu.c @@ -813,8 +813,11 @@ static int qcom_iommu_device_probe(struct platform_device *pdev) qcom_iommu->dev = dev; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (res) + if (res) { qcom_iommu->local_base = devm_ioremap_resource(dev, res); + if (IS_ERR(qcom_iommu->local_base)) + return PTR_ERR(qcom_iommu->local_base); + } qcom_iommu->iface_clk = devm_clk_get(dev, "iface"); if (IS_ERR(qcom_iommu->iface_clk)) {