Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2491702pxa; Mon, 17 Aug 2020 10:56:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTY+dW0CGm5gWAn+mIwgKbKfcvrzp5XBXyduylha9H5R+ghTHQ8/4k6tiCNhWqEnj/g4hR X-Received: by 2002:a17:906:7e57:: with SMTP id z23mr15923703ejr.294.1597686976719; Mon, 17 Aug 2020 10:56:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597686976; cv=none; d=google.com; s=arc-20160816; b=rRjHIWIOEaJWeoWI/CW6ROCcTZbVt9auT2OpdkK1UCsrlJdMbHVsAzjVAzXk4Q0YHj DKCbSanyWWQHBEiznL5rnbDscs7X6aaMcOlI+RK9hCN6IhF9v0cewcZ/k5c9sris2/m4 hyt4UgDZUMMr3GtsU+LoLZ7xq2w7QsE9bJ2Sne3MLRSeaSsDaGf37OjP2/ivucvAQYVz VySSTNz1k1RCStK0oN0UmVqmf5XcGlTg9806XWb38xkfY8jv0AxTxaQ7fYfl81wqD7dy /jnm8qNGgVKx0VnWJfzLJKH0XqYr4fAkq9zyr39ZTtV8jb/lENqlW9dQFo+MRaqs90M6 djEA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RMwzVrmZTm027lyS6NOpKBlRaOW07Wux/z0ZkY8NQeU=; b=G3hXi4l3zw9rdbU6L9iyAzxbQ6rdFBdp9iTGNwzmBtr1OFbEdCZbwa9bXhG5fCt/OE 0w4+aMLirZDr1tavTyd5JpP6bO455SyoGWiClo+2h0ahA+TG4U2flTzjciZ7ZDEUBTFT IIao0nrkeaa2kf43JwMkPLwKFTdbruN2jWnbog2GXVq6dw3Vq/YNq78jpLQyAiq8tJGS 8QMqz9F06iArbRoEREKDo3gJbDvwWN6Q9JsA/p+NiAX8OfEh6jUmZ957j4pOy48cD5O4 O6Drvp73Ro8MHKzmXbgQVCnfkOBcM065NKZoKwSt347aoIn3pQSsy0UfRo+PzBfTPRa9 v1pQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UekJDOnN; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n8si11512641ejj.649.2020.08.17.10.55.53; Mon, 17 Aug 2020 10:56:16 -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; dkim=pass header.i=@kernel.org header.s=default header.b=UekJDOnN; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388147AbgHQRwF (ORCPT + 99 others); Mon, 17 Aug 2020 13:52:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:41770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388643AbgHQQLw (ORCPT ); Mon, 17 Aug 2020 12:11:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E80BC207FB; Mon, 17 Aug 2020 16:11:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680708; bh=mnmT2vTfr2AGHT7TnBAtqI1K3Vf6MxmoQGA19qZ7NVQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UekJDOnNHL3LRZ74F4fTWyQwOZ4GwuUXldkxo+ek3a07dDfZ9lDVbCvE0glv/JTga cxEhA2JmIFnHQM4yIyPi4lF11oRAt+xgXrP8ULfWEDcqlTME6wD06m7Q8ADrA3RmED +TdOa5+NNOZI9vG+/cHQ9NfdBkbe7QUbrevZSS+U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai , Dinh Nguyen , Sasha Levin Subject: [PATCH 4.19 024/168] ARM: socfpga: PM: add missing put_device() call in socfpga_setup_ocram_self_refresh() Date: Mon, 17 Aug 2020 17:15:55 +0200 Message-Id: <20200817143734.931200033@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143733.692105228@linuxfoundation.org> References: <20200817143733.692105228@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Kuai [ Upstream commit 3ad7b4e8f89d6bcc9887ca701cf2745a6aedb1a0 ] if of_find_device_by_node() succeed, socfpga_setup_ocram_self_refresh doesn't have a corresponding put_device(). Thus add a jump target to fix the exception handling for this function implementation. Fixes: 44fd8c7d4005 ("ARM: socfpga: support suspend to ram") Signed-off-by: Yu Kuai Signed-off-by: Dinh Nguyen Signed-off-by: Sasha Levin --- arch/arm/mach-socfpga/pm.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-socfpga/pm.c b/arch/arm/mach-socfpga/pm.c index d4866788702cb..b782294ee30bc 100644 --- a/arch/arm/mach-socfpga/pm.c +++ b/arch/arm/mach-socfpga/pm.c @@ -60,14 +60,14 @@ static int socfpga_setup_ocram_self_refresh(void) 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, socfpga_sdram_self_refresh_sz); 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); @@ -78,7 +78,7 @@ static int socfpga_setup_ocram_self_refresh(void) if (!suspend_ocram_base) { pr_warn("%s: __arm_ioremap_exec failed!\n", __func__); ret = -ENOMEM; - goto put_node; + goto put_device; } /* Copy the code that puts DDR in self refresh to ocram */ @@ -92,6 +92,8 @@ static int socfpga_setup_ocram_self_refresh(void) if (!socfpga_sdram_self_refresh_in_ocram) ret = -EFAULT; +put_device: + put_device(&pdev->dev); put_node: of_node_put(np); -- 2.25.1