Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1895995iob; Thu, 19 May 2022 18:12:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyB5nvehY/Jud3PXbHhLAMTlcGyDXR0tX4D8GHx08rukPNcjYFo45AWDFzNinHLDBgOrJs X-Received: by 2002:a17:90a:14a6:b0:1dc:f64f:ff2c with SMTP id k35-20020a17090a14a600b001dcf64fff2cmr8036733pja.161.1653009145865; Thu, 19 May 2022 18:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653009145; cv=none; d=google.com; s=arc-20160816; b=oOv8ZoNdkn7/4/C1zjwroiOASbllWcoF5jdTFYSHjyB6n+obtzS6Dwz57xzKQ86W6g 2PY3If5rqDj62iS+h/oOVtHiUIq/YXkl8Udi1FzZy/z8O5/nQI8DwWOU3f28QRv2sE0c 5UeS6GgTuFLVgP2nkysJ0TWkTHkRX6jYG7C1wKOErOPDU8ORG4hf5Ly+q+K4q9uHBJoi cLejxg4E6lbp6vSqfXx4k2hoknqowwKBYRb4vz8JpzsPlS5PfswtY+N8zftLTD/dwn0i cuEeu0ZAznD9HOCSLvE0hKRF1fIggfutRYL0iV75TisJLH24tjr3hCL94E3iKxz39WAM nnYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=7fCSWpw+tRWCRAiPB4oHBoQsf5anEjOs5B157usntB0=; b=ARV83uldkFsk36G2BsKcPgMgzUpz29TKvhYGlWvE3/MuVvBrH+M/jp2F/yVl/G7T2y qrwCRJMdkGDGH32pVN9zY+6mtz7+5FDG6pRFn54oZgyqMXeSsWL9OHDP9hN8Kb2g1LUY XlJS+ZB7E9NCPPwZxzfV4B4+UmQqD0w2Aqp8/OrD+SD3+erg7BgKptWegYsp9MjbKje6 onqqK9x533qUjCDtnQYBUhEeghMztu5eRE7x423cc8GoBIAWt0BgsTdIXRU7rEq6Jnwm 1OMghvtYuf3um7VZ0tZuS4XqVsdi+jmkEvi29hiM3REkrQuPvn7tzXi3wk/vuj4fSKuu LUSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b="ibe/MwLF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c11-20020a63350b000000b003aae4f1097asi8237286pga.559.2022.05.19.18.12.14; Thu, 19 May 2022 18:12:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b="ibe/MwLF"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236095AbiESJhe (ORCPT + 99 others); Thu, 19 May 2022 05:37:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230428AbiESJhb (ORCPT ); Thu, 19 May 2022 05:37:31 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 853EF78918; Thu, 19 May 2022 02:37:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1652953037; bh=N4+dzENszk7EjcP6QEPG3DSK2vLDP5A+aM1bUGENtoU=; h=X-UI-Sender-Class:Date:Subject:To:References:From:In-Reply-To; b=ibe/MwLFCPT67vMgQQXi6vRQIrAFoU9fJmtE+jbjTLRMB4YXectMWQnNabbOdeCLb BwrvVEnEgJThlDh6vsO+8XIaBXX42iXvnoWmrfp9BCJMtzf+O4us/rgB86Vm3geXWY sYtnZOTvBf0y2N+0XOpAtXkI09Rmryv2pItPk8Wo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.20.60] ([92.116.152.7]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MMGN2-1o7dH90PG2-00JGVp; Thu, 19 May 2022 11:37:17 +0200 Message-ID: Date: Thu, 19 May 2022 11:37:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH -next] video: fbdev: pxa3xx-gcu: release the resources correctly in pxa3xx_gcu_probe/remove() Content-Language: en-US To: Yang Yingliang , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org References: <20220513100541.2665467-1-yangyingliang@huawei.com> From: Helge Deller In-Reply-To: <20220513100541.2665467-1-yangyingliang@huawei.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:ebaSU/xZ4T/UJa7gN3ZOW6FXe26rKla8kTIdy+5kcvbSvy25IJn uJktWwDhmDVMgZZt+EyTXX5QPgL7yKQZ5Pk7XBn0EVjVNwpkXGR+tp7clsC4a8/DUYA76By 3WJTdp1BET2BUeHJqxhVmQbbN2uyHySZNDFTq6eO5LvFSzgRDR7kPhQ71BBz1fk3cn7K/5G BKtgtt54OmA2dCx5kKAFg== X-UI-Out-Filterresults: notjunk:1;V03:K0:vbKg9C5u+iQ=:Kt1F/dbe2n8qiSHFmm4uwM nqvnToH/GMrC+66E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iesA 91Cf5i8pl48NXMSulWcuigJVxp7XU9TuXHyOzcGyeYwcvU94rVyNHn4AQ== X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/13/22 12:05, Yang Yingliang wrote: > In pxa3xx_gcu_probe(), the sequence of error lable is wrong, it will > leads some resource leaked, so adjust the sequence to handle the error > correctly, and if pxa3xx_gcu_add_buffer() fails, pxa3xx_gcu_free_buffers= () > need be called. > In pxa3xx_gcu_remove(), add missing clk_disable_unpreprare(). > > Signed-off-by: Yang Yingliang applied to fbdev tree. Thanks! Helge > --- > drivers/video/fbdev/pxa3xx-gcu.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3= xx-gcu.c > index 350b3139c863..043cc8f9ef1c 100644 > --- a/drivers/video/fbdev/pxa3xx-gcu.c > +++ b/drivers/video/fbdev/pxa3xx-gcu.c > @@ -646,6 +646,7 @@ static int pxa3xx_gcu_probe(struct platform_device *= pdev) > for (i =3D 0; i < 8; i++) { > ret =3D pxa3xx_gcu_add_buffer(dev, priv); > if (ret) { > + pxa3xx_gcu_free_buffers(dev, priv); > dev_err(dev, "failed to allocate DMA memory\n"); > goto err_disable_clk; > } > @@ -662,15 +663,15 @@ static int pxa3xx_gcu_probe(struct platform_device= *pdev) > SHARED_SIZE, irq); > return 0; > > -err_free_dma: > - dma_free_coherent(dev, SHARED_SIZE, > - priv->shared, priv->shared_phys); > +err_disable_clk: > + clk_disable_unprepare(priv->clk); > > err_misc_deregister: > misc_deregister(&priv->misc_dev); > > -err_disable_clk: > - clk_disable_unprepare(priv->clk); > +err_free_dma: > + dma_free_coherent(dev, SHARED_SIZE, > + priv->shared, priv->shared_phys); > > return ret; > } > @@ -683,6 +684,7 @@ static int pxa3xx_gcu_remove(struct platform_device = *pdev) > pxa3xx_gcu_wait_idle(priv); > misc_deregister(&priv->misc_dev); > dma_free_coherent(dev, SHARED_SIZE, priv->shared, priv->shared_phys); > + clk_disable_unprepare(priv->clk); > pxa3xx_gcu_free_buffers(dev, priv); > > return 0;