Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2635975pxa; Mon, 17 Aug 2020 15:05:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKuhclavEIbV2933RPahx5QaiCB9vYDDxagv2rmpHnjWB7/Ryfp3rXyuoZ+4X/RTuxwYGq X-Received: by 2002:a17:906:a84f:: with SMTP id dx15mr17025850ejb.377.1597701901364; Mon, 17 Aug 2020 15:05:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597701901; cv=none; d=google.com; s=arc-20160816; b=VsaOxXQ0JsG0rpy5jSsro/B7K4SnzjngC3AxFwWU37NsL5sI9DagDlIfSJ5RnJW8B0 Ggt6x4tFQo7xiSn46xwGq0ZOzZi1BrDX5fqARjSAqXtOV2nQ2LxzOhEz92N+tfSSpPzp QpIV62naOBwZ/vfrVyZnNbEwvDJCv4tdkhGV60tpbml1dpwSg9OQL9XSE0aaeyu9pAYG 1VLbtCzJj1uF+KHsClVKPJlsLoKgOxowgxdC5ZxvmNz1/N+wnd6iPgWbg68Q+c9OdXqM Ff8/DNtoOX+0zphtcwghgteZQI0iWJQF+yzmep3rF3pQEycu293fNqikxF9IGQojhpjf cJ8A== 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=n42sl+yDJ8YlengnW/2hDphHaTGD0N5a27rkd/YFJfk=; b=vsjIovD7EOzVGLlJxkPvEN8KFiO76DgCzoqfzDwrnYuLkqoh0uNvj6/iijpl1db6VX y+rgDmaiGoFwtc0MkYj84WSoYKdy9k4/FXgsQUNd30UZs1R4bhmIS8TN5B6mQeEzpqNl omChbqCadOFW8FhEClHp33pp2pEmhmVVCpx4UJj3SGLpqmkXxgOe6Oxfwq/r4kxsi+Rc Zof16Dp6I6kDhVXjmCvuB7DljeDMnQ0Hn9hnafHmepFYNDBgXTELcbTfOU6L6WouSlpe Bl4t/kRFSFPjRonZW4plpQm/oIjxFcPdVHP7JjE0DYl9SCR37DQi0fNvgLU40uUR1sCP vZTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VsMnwPWM; 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 u1si12676608edp.392.2020.08.17.15.04.38; Mon, 17 Aug 2020 15:05:01 -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=VsMnwPWM; 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 S2388061AbgHQPz6 (ORCPT + 99 others); Mon, 17 Aug 2020 11:55:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:51892 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387492AbgHQPmC (ORCPT ); Mon, 17 Aug 2020 11:42:02 -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 531F722D00; Mon, 17 Aug 2020 15:42:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678922; bh=WY+eO/9Lahljm8HW8woM/npGtNCkHd0cv1BtYYsClx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VsMnwPWMHbRlEJdh9nyqLk3GPVIOpZjXj6FZZ+8EAIDoe4YP08/AaUE9/xQjVgpYx jVHHWksOJTsEMo1LcHvbLqptJiU+hzOmirEH01EhEfSCM7x+REGO/T4jitNCFo6NKB Lx+yex/JLS52b28EmQc8anP7ndl/03mGPs4vbNr0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, yu kuai , Alexandre Belloni , Sasha Levin Subject: [PATCH 5.7 036/393] ARM: at91: pm: add missing put_device() call in at91_pm_sram_init() Date: Mon, 17 Aug 2020 17:11:26 +0200 Message-Id: <20200817143821.358732342@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@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 f87a4f022c44e5b87e842a9f3e644fba87e8385f ] if of_find_device_by_node() succeed, at91_pm_sram_init() doesn't have a corresponding put_device(). Thus add a jump target to fix the exception handling for this function implementation. Fixes: d2e467905596 ("ARM: at91: pm: use the mmio-sram pool to access SRAM") Signed-off-by: yu kuai Signed-off-by: Alexandre Belloni Link: https://lore.kernel.org/r/20200604123301.3905837-1-yukuai3@huawei.com Signed-off-by: Sasha Levin --- arch/arm/mach-at91/pm.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 074bde64064e4..2aab043441e8f 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -592,13 +592,13 @@ static void __init at91_pm_sram_init(void) sram_pool = gen_pool_get(&pdev->dev, NULL); if (!sram_pool) { pr_warn("%s: sram pool unavailable!\n", __func__); - return; + goto out_put_device; } sram_base = gen_pool_alloc(sram_pool, at91_pm_suspend_in_sram_sz); if (!sram_base) { pr_warn("%s: unable to alloc sram!\n", __func__); - return; + goto out_put_device; } sram_pbase = gen_pool_virt_to_phys(sram_pool, sram_base); @@ -606,12 +606,17 @@ static void __init at91_pm_sram_init(void) at91_pm_suspend_in_sram_sz, false); if (!at91_suspend_sram_fn) { pr_warn("SRAM: Could not map\n"); - return; + goto out_put_device; } /* Copy the pm suspend handler to SRAM */ at91_suspend_sram_fn = fncpy(at91_suspend_sram_fn, &at91_pm_suspend_in_sram, at91_pm_suspend_in_sram_sz); + return; + +out_put_device: + put_device(&pdev->dev); + return; } static bool __init at91_is_pm_mode_active(int pm_mode) -- 2.25.1