Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1272565ybg; Thu, 4 Jun 2020 05:44:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQHyV+5cnr1meNC3p0LDY1joQ+ieoxvztiQnavA1AtviPJ6f1fHBnbmIqZUhwjHjnqexKS X-Received: by 2002:aa7:ce10:: with SMTP id d16mr4225864edv.116.1591274694891; Thu, 04 Jun 2020 05:44:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591274694; cv=none; d=google.com; s=arc-20160816; b=ju/9U5qJYhQSieVQzBP98yovN5fnC5DO4sHQ8ZzPfjYvFjddgeVNdptk0Og68yhZ0b uZ+USNbwoo96EGKZSD1HUioWsuFGzGmMd0IPFVYPjZZWadrHtXRddpRmnNZvm5EzVjLa iOVmzzAv89x4yKSAIJ+qVS17BjKXNcGJNLryoaPqfSzZz0ljTjGiaBPzhuxZXdOyAwej xD474Wk44GFmpe7HRGmpCZ/nqzx4amghzVgU8jIenYyXdpvwgO8vdHBUa13rZoKm2F/W CjmbhDZMiMhTKqt2VKsHmkzfFgWJ8bqDs/S/liQfcAvE+fU9i88xF514k5miR1D5sgFN CQMA== 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=cylZCsb4xCv9GGsb82Arwd8qjZzFp+Vs1ovFFQXVXaU=; b=h4tIhRNVTlYS6Ayv4gYsuINhjdJZbNQzaolYKM9b5fimzeaNcXsWPAm29NSz1hj/k7 ccSk+0U++frDQBdCYFrEebrkwIKOKn0ODsb3GV377u9VWRbwUpCxkiVm59Uujr7g/tfo bFPCYciHhswF+aw7O7k7IB5lDNiYm9w8IjcBrrMBGKFLpDUwmueMRl7Z6RPqS9hPsMAK n+Yu9tX8oR5RCSCoQUk/1Kg4cbuXBB+H3ardGw66TZevvH4sANF8N6MyNwpSf9MFGetP 1EkrbA+xnoQBHQt/thzFCvfk4oq3bGyxB852e6DANeQ8XS7U6/dP5NM63GcHcLb9KAS3 xu0w== 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 t4si1718751edt.0.2020.06.04.05.44.30; Thu, 04 Jun 2020 05:44: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 S1726228AbgFDMmh (ORCPT + 99 others); Thu, 4 Jun 2020 08:42:37 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:47912 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725926AbgFDMmh (ORCPT ); Thu, 4 Jun 2020 08:42:37 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 34AB5D31768ADE9DB047; Thu, 4 Jun 2020 20:42:35 +0800 (CST) Received: from huawei.com (10.175.104.175) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.487.0; Thu, 4 Jun 2020 20:42:28 +0800 From: yu kuai To: , , , , , CC: , , , Subject: [PATCH] ARM: imx5: add missing put_device() call in imx_suspend_alloc_ocram() Date: Thu, 4 Jun 2020 20:42:06 +0800 Message-ID: <20200604124206.3910721-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, imx_suspend_alloc_ocram() doesn't have a corresponding put_device(). Thus add a jump target to fix the exception handling for this function implementation. Fixes: 1579c7b9fe01 ("ARM: imx53: Set DDR pins to high impedance when in suspend to RAM.") Signed-off-by: yu kuai --- arch/arm/mach-imx/pm-imx5.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c index f057df813f83..e9962b48e30c 100644 --- a/arch/arm/mach-imx/pm-imx5.c +++ b/arch/arm/mach-imx/pm-imx5.c @@ -295,14 +295,14 @@ static int __init imx_suspend_alloc_ocram( 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, size); if (!ocram_base) { pr_warn("%s: unable to alloc ocram!\n", __func__); ret = -ENOMEM; - goto put_node; + goto put_device; } phys = gen_pool_virt_to_phys(ocram_pool, ocram_base); @@ -312,6 +312,8 @@ static int __init imx_suspend_alloc_ocram( if (virt_out) *virt_out = virt; +put_device: + put_device(&pdev->dev); put_node: of_node_put(node); -- 2.25.4