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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 CE61EC433DF for ; Thu, 2 Jul 2020 20:11:18 +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 9738020890 for ; Thu, 2 Jul 2020 20:11:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="3lR59poY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9738020890 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com 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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wIMuLz/PQ4qMs3C9YT9/DGgIN+tlGcnFUiFoQuQtQV8=; b=3lR59poYVFJwsGf1UR63V6pYB LvKykOtwaHAVdpzH2G/bCJKmL5lDE4/6koQCkzxI89HoDytu7q+yXSjUNfpSpWP1itzwwmDPk5ioF LjetqwG6xq5NH6RczhRrSuAiQbVDjc0esUfcTlvKEVH/h0E6eGr+WQijD8GzaumoJPiLwzUnXCs5R vLfG6N5n/KKJ0vIXOAEL+tyoeYegxnjCg1fr4E/nKhCnnk01UEpWqDt+FSKS+SNRjMw2Og3J2vzNy dFK6HdPS2eW+h4ClPQy7wBUoamUryI8sNfQA1Jw/gznovWMDBKmYtTjiSyoBc66ZFcNafEcLmh3vD LA31ClFGg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jr5WM-0004Sh-FR; Thu, 02 Jul 2020 20:09:22 +0000 Received: from relay6-d.mail.gandi.net ([217.70.183.198]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jr5WJ-0004S7-Ml for linux-arm-kernel@lists.infradead.org; Thu, 02 Jul 2020 20:09:20 +0000 X-Originating-IP: 90.65.108.121 Received: from localhost (lfbn-lyo-1-1676-121.w90-65.abo.wanadoo.fr [90.65.108.121]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id D1CCFC0004; Thu, 2 Jul 2020 20:09:15 +0000 (UTC) Date: Thu, 2 Jul 2020 22:09:15 +0200 From: Alexandre Belloni To: yu kuai Subject: Re: [PATCH] ARM: at91: pm: add missing put_device() call in at91_pm_sram_init() Message-ID: <20200702200915.GC6538@piout.net> References: <20200604123301.3905837-1-yukuai3@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200604123301.3905837-1-yukuai3@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200702_160919_981860_16DA89F4 X-CRM114-Status: GOOD ( 15.71 ) 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: yi.zhang@huawei.com, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, ludovic.desroches@microchip.com, 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 Hi, On 04/06/2020 20:33:01+0800, yu kuai wrote: > 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 > --- > 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 074bde64064e..2aab043441e8 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); Isn't the best solution to simply have put_device here? > 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.4 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel