Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2665405pxa; Mon, 17 Aug 2020 15:59:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM7zJaKIshVsOjWaMRN/jhAfRn0WC4003x8aJqWXttDA0buy/HofWh2CsdGYJ4JHB+Hydh X-Received: by 2002:a05:6402:17bb:: with SMTP id j27mr16565854edy.291.1597705187665; Mon, 17 Aug 2020 15:59:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597705187; cv=none; d=google.com; s=arc-20160816; b=zZpHjQn7E0rE3zWdk0zCe/Td3RoaWaVe8E0CaaBoQ/ERPIfHQpAzdUbvIwH/3G3PNm KcEM2DM4GMeWd9Y8vZeMGf2x21BQnQt2cUnkgVcUhp9sqHBxsgp1kh+toN1tiQGXZ1Zy 3IfjXH7PCyL6Ko0vUULuAzBY1wx93peEniJK8eIKPXtL+0ifbR1S6Jb0EFYRqnu1z5KB eSnvN4PGpH7ipdxxFfAV++cwPOChvOLBxwCKPHqW5jfEnU4QZuDBfGx7bedsKAj9kn5k oe6AG6Fvrr8enL4hjd6v5ZmXv/w95/e39giCE7Yuu8KEdun8vuEn6nzpjcE3l2e1DBpK G0Aw== 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=NgoDtdgZnlb2DlsDC//s4/sOF+bJG+Dc6ibs0bcSqis4vu2HRTdOYDwDBeR1g8CXE/ tmoXclkSOF5zd79DSGMCjTtu3rFl8+d9qA+jJwhXW6S9uJcCKgJ9G+4sMJxRqVweikDc F2ue3DVIg5ONcqW9aWSWC1o0aR3dWHzjn2CXQEkVTkXGaAX/n+10IFhgmRGpIDfm7+zr ODuvQTR9z0eGSNhuga1jm6EbfHKA0mSBGJYMA3FjJwKmKlKkDGqf/LVHZadQAj4YOP9D A3XrnerI48oYWu0F8GEK+FUdDCRQxKWtXOMB9vbS2fca4o+HGAegV3GFad1vrQfmFESc UThg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aohtdjzu; 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 b7si14953652edz.404.2020.08.17.15.59.24; Mon, 17 Aug 2020 15:59:47 -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=aohtdjzu; 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 S1732788AbgHQTtm (ORCPT + 99 others); Mon, 17 Aug 2020 15:49:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:41644 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729239AbgHQPT6 (ORCPT ); Mon, 17 Aug 2020 11:19:58 -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 B9CF22078B; Mon, 17 Aug 2020 15:19:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597677598; bh=WY+eO/9Lahljm8HW8woM/npGtNCkHd0cv1BtYYsClx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aohtdjzu32HJid4luP4JwcHjvB/zYOGhMv6M+5aWTEjX4ILVvhq+JweLXj7uHa+Tk X6yTh90qXX9GJIckcJ3DolNsyRjtT/EUMciW1VKcswm7FNFnahrHDPqC1P47liVUQN 5wncje5zDhTqG0hGhyFNUcnT0XZIqpfk4YRynY6A= 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.8 039/464] ARM: at91: pm: add missing put_device() call in at91_pm_sram_init() Date: Mon, 17 Aug 2020 17:09:52 +0200 Message-Id: <20200817143835.627454908@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@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