From patchwork Wed Apr 29 04:34:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 11516071 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 36C37112C for ; Wed, 29 Apr 2020 06:45:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 1FA13206D6 for ; Wed, 29 Apr 2020 06:45:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1FA13206D6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=wanadoo.fr Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 375836EC9A; Wed, 29 Apr 2020 06:45:02 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.smtpout.orange.fr (smtp13.smtpout.orange.fr [80.12.242.135]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8AE2E6EC29 for ; Wed, 29 Apr 2020 04:34:53 +0000 (UTC) Received: from localhost.localdomain ([92.148.159.11]) by mwinf5d72 with ME id YUak220030F2omL03UalTv; Wed, 29 Apr 2020 06:34:51 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Wed, 29 Apr 2020 06:34:51 +0200 X-ME-IP: 92.148.159.11 From: Christophe JAILLET To: b.zolnierkie@samsung.com, gregkh@linuxfoundation.org, mpe@ellerman.id.au, zhenzhong.duan@gmail.com, arnd@arndb.de, tglx@linutronix.de, eric.y.miao@gmail.com, daniel@caiaq.de Subject: [PATCH] video: fbdev: pxa3xx_gcu: Fix some resource leak in an error handling path in 'pxa3xx_gcu_probe()' Date: Wed, 29 Apr 2020 06:34:38 +0200 Message-Id: <20200429043438.96212-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 29 Apr 2020 06:45:00 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christophe JAILLET , linux-fbdev@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" If an error occurs in the loop where we call 'pxa3xx_gcu_add_buffer()', any resource already allocated should be freed. In order to fix it, add a call to 'pxa3xx_gcu_free_buffers()' in the error handling path, as already done in the remove function. Fixes: 364dbdf3b6c3 ("video: add driver for PXA3xx 2D graphics accelerator") Signed-off-by: Christophe JAILLET --- drivers/video/fbdev/pxa3xx-gcu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/fbdev/pxa3xx-gcu.c b/drivers/video/fbdev/pxa3xx-gcu.c index 4279e13a3b58..68d9c7a681d4 100644 --- a/drivers/video/fbdev/pxa3xx-gcu.c +++ b/drivers/video/fbdev/pxa3xx-gcu.c @@ -675,6 +675,7 @@ static int pxa3xx_gcu_probe(struct platform_device *pdev) err_disable_clk: clk_disable_unprepare(priv->clk); + pxa3xx_gcu_free_buffers(dev, priv); return ret; }