Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1516168ybg; Thu, 4 Jun 2020 11:38:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmJaYiSswCAc1fsO/JiMrv+CJLVLHK0d5dHvSglELp0eH8b8fGqqnFB33RWfSHi9gYMfAV X-Received: by 2002:a05:6402:1bde:: with SMTP id ch30mr5709897edb.163.1591295934714; Thu, 04 Jun 2020 11:38:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591295934; cv=none; d=google.com; s=arc-20160816; b=pAFjbm9lv/hp2OkWo6qVsRU037S9XlEHObERYfcmdmCxOzfoZ3O5wzWPyLjAu3Jflz c3aOdaCNjzxMDDulum4JgNA+s8/IYjNT9T9Pfw6S/T/pHyyWEiTXKOTuY7zUMBmmAOHh bPENzmBxLFx4/5Tn2kXcI40hfrsJJH2mAM86yw/zKxnW6qHNV5bjzHrIMTH9y+IC5hb1 FMEesj7BhfdxCoQ+p6o7gY3S7hHS8kLSKDvSlO1L4YGna8aumuxshSYWXzpc9xhtQGad Ij1fDbq8aftzv5GThRQIJBEvo43XxEBZZ8v+JKfrHu2IScpmbOcTEoR2nY45zXrDsUQB 7LNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=6PiinwUcrgFuwy+WDy3HvWhPX1bkq7SBXOzysC6dZ6c=; b=IwpDnwHahmC/AfiVtkFq44/i0AMzkOCLzuBNL7x+SRqq6MLAX9lwmeWL2ICPWho/bA klKCN8cgKGNFzh7Gs7doS9wJ9zHOBwpDcAyxDdUFWBZyK8vHVDf35lTAqIHxs/EqrlXB yXG0M+kPOG4UwphbKQ1emZrmQP62LJnC/TqMXXV0C4SDbjts5XSKTGYzfsJ6+YvERz1r ja4LL7dDvrb2BluS2R2CrI9Jy8RJohYfk8gdF9NZtyGyFaUoEXuy73w/HN1DY1gbnhja vEl0bKkAIKrhFXUYvFF4vUpNBsNO+uDAtjV3GMUwzdnoNISiV6DthcnMi9nigxVP1TyA TBsA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y89si1957119edy.357.2020.06.04.11.38.31; Thu, 04 Jun 2020 11:38:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726814AbgFDMzW (ORCPT + 99 others); Thu, 4 Jun 2020 08:55:22 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:5786 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726003AbgFDMzW (ORCPT ); Thu, 4 Jun 2020 08:55:22 -0400 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id AC2FA10A86605A74B66A; Thu, 4 Jun 2020 20:55:18 +0800 (CST) Received: from huawei.com (10.175.104.175) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Thu, 4 Jun 2020 20:55:11 +0800 From: yu kuai To: , , , , , , CC: , , , Subject: [PATCH] ARM: imx6: add missing put_device() call in imx6q_suspend_init() Date: Thu, 4 Jun 2020 20:54:49 +0800 Message-ID: <20200604125449.3917164-1-yukuai3@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.175] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org if of_find_device_by_node() succeed, imx6q_suspend_init() doesn't have a corresponding put_device(). Thus add a jump target to fix the exception handling for this function implementation. Signed-off-by: yu kuai --- arch/arm/mach-imx/pm-imx6.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c index dd34dff13762..40c74b4c4d73 100644 --- a/arch/arm/mach-imx/pm-imx6.c +++ b/arch/arm/mach-imx/pm-imx6.c @@ -493,14 +493,14 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) if (!ocram_pool) { pr_warn("%s: ocram pool unavailable!\n", __func__); ret = -ENODEV; - goto put_node; + goto put_device; } ocram_base = gen_pool_alloc(ocram_pool, MX6Q_SUSPEND_OCRAM_SIZE); if (!ocram_base) { pr_warn("%s: unable to alloc ocram!\n", __func__); ret = -ENOMEM; - goto put_node; + goto put_device; } ocram_pbase = gen_pool_virt_to_phys(ocram_pool, ocram_base); @@ -523,7 +523,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) ret = imx6_pm_get_base(&pm_info->mmdc_base, socdata->mmdc_compat); if (ret) { pr_warn("%s: failed to get mmdc base %d!\n", __func__, ret); - goto put_node; + goto put_device; } ret = imx6_pm_get_base(&pm_info->src_base, socdata->src_compat); @@ -570,7 +570,7 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) &imx6_suspend, MX6Q_SUSPEND_OCRAM_SIZE - sizeof(*pm_info)); - goto put_node; + goto put_device; pl310_cache_map_failed: iounmap(pm_info->gpc_base.vbase); @@ -580,6 +580,8 @@ static int __init imx6q_suspend_init(const struct imx6_pm_socdata *socdata) iounmap(pm_info->src_base.vbase); src_map_failed: iounmap(pm_info->mmdc_base.vbase); +put_device: + put_device(&pdev->dev); put_node: of_node_put(node); -- 2.25.4