From patchwork Thu Dec 10 14:48:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 11967503 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=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 C8A03C433FE for ; Fri, 11 Dec 2020 08:16:58 +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 60C6023E56 for ; Fri, 11 Dec 2020 08:16:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60C6023E56 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 CAD4A6ECA8; Fri, 11 Dec 2020 08:16:22 +0000 (UTC) Received: from smtp.smtpout.orange.fr (smtp08.smtpout.orange.fr [80.12.242.130]) by gabe.freedesktop.org (Postfix) with ESMTPS id 126836EAC8 for ; Thu, 10 Dec 2020 14:48:53 +0000 (UTC) Received: from localhost.localdomain ([92.131.12.169]) by mwinf5d15 with ME id 2eoj2400H3eqQsk03eokPw; Thu, 10 Dec 2020 15:48:48 +0100 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 10 Dec 2020 15:48:48 +0100 X-ME-IP: 92.131.12.169 From: Christophe JAILLET To: daniel.vetter@ffwll.ch, grandmaster@al2klimov.de Subject: [PATCH 1/2] video: fbdev: Use framebuffer_release instead of kfree to free a frame buffer Date: Thu, 10 Dec 2020 15:48:08 +0100 Message-Id: <20201210144808.64384-1-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 11 Dec 2020 08:16:08 +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" Use 'framebuffer_release()' instead of 'kfree()' to undo a 'framebuffer_alloc()' call, both in the error handling path of the probe function and in remove function. Signed-off-by: Christophe JAILLET --- drivers/video/fbdev/ep93xx-fb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/fbdev/ep93xx-fb.c b/drivers/video/fbdev/ep93xx-fb.c index ba33b4dce0df..80a70e5796b8 100644 --- a/drivers/video/fbdev/ep93xx-fb.c +++ b/drivers/video/fbdev/ep93xx-fb.c @@ -566,7 +566,7 @@ static int ep93xxfb_probe(struct platform_device *pdev) failed_videomem: fb_dealloc_cmap(&info->cmap); failed_cmap: - kfree(info); + framebuffer_release(info); return err; } @@ -584,7 +584,7 @@ static int ep93xxfb_remove(struct platform_device *pdev) if (fbi->mach_info->teardown) fbi->mach_info->teardown(pdev); - kfree(info); + framebuffer_release(info); return 0; }