From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 095C8C433E0 for ; Sun, 9 Aug 2020 00:03:27 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B26B3206C0 for ; Sun, 9 Aug 2020 00:03:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="WPz3q7fv"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="WxEAj6s9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B26B3206C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Wp9Dj0t7L6sXed7uKhdqEC14uW2VAi5TkWQZaEzA9wc=; b=WPz3q7fvGMRISC1Jkd7L/vdM0 dJcNAiDi7xPkOIW+dzwDr7L1IzyKr+MLB7+q/qhrPEBdUZ8gAZ9oeoUNYHNo8H0hJ55jlC/BAuivH wWTx6vjTuI2K7sX5g39MOvRS/hW6++TXHLX75YWpKfSbA3nxgICkkJtsacyJRIsEnH37Qaaci3RKf jCDYstchBQukYFzTMV0Vn5lTl6r0eIZeqX9h/vqJgvZ0w3aX1yX80Qc1a5Q26KPqXnZGRH+zjQplJ 8tQDejKZhTFJX3QgJHs7NW4S4c5kalTxVeOokDQ0GVNNH8kim1k38b54VcRHQVB6kKHPabwTR0iHL t5KVlCdIg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k4YmK-0000ux-Bw; Sun, 09 Aug 2020 00:01:32 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k4YS2-0002x8-M1 for linux-arm-kernel@lists.infradead.org; Sat, 08 Aug 2020 23:40:37 +0000 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 485B320829; Sat, 8 Aug 2020 23:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596930033; bh=nVOubqGaz1Pn4VP4TyGxSbinfJTFRl16sBbWFwEg4zM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WxEAj6s9awj+nbLkSXxBcbF8fwGYs/6HvTldncxJbg8HLUgI806PIBROZTcTZT7ox 6E+6MiSfWFlJ/lkcvRv+wHUdNBP+NIcN56ohCKrXkirU0gNQ2fxshOX/xU1l/1P7G9 gTUKCnpf1x1l0iT9lEcS/Ns+P4+5Ilu6FjpRF/0E= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 12/14] ARM: at91: pm: add missing put_device() call in at91_pm_sram_init() Date: Sat, 8 Aug 2020 19:40:11 -0400 Message-Id: <20200808234013.3619541-12-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200808234013.3619541-1-sashal@kernel.org> References: <20200808234013.3619541-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200808_194036_390638_6FEB440E X-CRM114-Status: GOOD ( 12.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , yu kuai , Alexandre Belloni , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 849014c01cf4d..bebaa0b0aef40 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -456,13 +456,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); @@ -470,12 +470,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 void __init at91_pm_backup_init(void) -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C34F6C433DF for ; Sat, 8 Aug 2020 23:41:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 997232053B for ; Sat, 8 Aug 2020 23:41:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596930106; bh=nVOubqGaz1Pn4VP4TyGxSbinfJTFRl16sBbWFwEg4zM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=LJemCwuCZ/PT9s85BTQjlB+t7349mehaLZ6tT0uX7evwv/dD5ctWAd0nBqjPkUmfT s19vj/LdgReBUzlRbRgCptcZIFKI0V+KaFVvvIaIDm+y/ZzPHmZ63C4+oYM2E7LlQF 3IW0xSP07/9WpCwG8733frAPlhe5mVsXAlfWbJLE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728994AbgHHXlp (ORCPT ); Sat, 8 Aug 2020 19:41:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:56116 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726643AbgHHXke (ORCPT ); Sat, 8 Aug 2020 19:40:34 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 485B320829; Sat, 8 Aug 2020 23:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596930033; bh=nVOubqGaz1Pn4VP4TyGxSbinfJTFRl16sBbWFwEg4zM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WxEAj6s9awj+nbLkSXxBcbF8fwGYs/6HvTldncxJbg8HLUgI806PIBROZTcTZT7ox 6E+6MiSfWFlJ/lkcvRv+wHUdNBP+NIcN56ohCKrXkirU0gNQ2fxshOX/xU1l/1P7G9 gTUKCnpf1x1l0iT9lEcS/Ns+P4+5Ilu6FjpRF/0E= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: yu kuai , Alexandre Belloni , Sasha Levin , linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 4.14 12/14] ARM: at91: pm: add missing put_device() call in at91_pm_sram_init() Date: Sat, 8 Aug 2020 19:40:11 -0400 Message-Id: <20200808234013.3619541-12-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200808234013.3619541-1-sashal@kernel.org> References: <20200808234013.3619541-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore 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 849014c01cf4d..bebaa0b0aef40 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c @@ -456,13 +456,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); @@ -470,12 +470,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 void __init at91_pm_backup_init(void) -- 2.25.1