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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 678FECF34BA for ; Thu, 3 Oct 2024 16:20:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8VFCquFTBw+dL27Xzp2OsRt1sPML0xALYJmjaiCuhhM=; b=j3G9i03EYv9ROX81tgsrzlteql 8Xzzs190NbtrtToGzx+hpi0XXOjl+MTCLIuqz7nhyK/h1yHradeBCpgSOWDbXVqVLpErMO9bp6iDX 7DOEYmKQWwDFANbgPv5AF8tvaklqp4+qz6Z/2GSEAQi1aNNX0MOo5K+VImpvseQVcHJEoa57lEGlw bD3UjpxpH5hu0dQCCxfrOuA593y12GEFf4jEmRlmKCpdJlOyntazPJyYOEvxnNOtClF382eFParmX WH3PTQX+5ZECEWL22f2Uf7bKkJ6FKSvy1LKNdQmIB8z9RnBLy4k8INB1Dz1W8e3j24TpE1peN7d1e hONI0zEg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swOYj-00000009npv-1WAj; Thu, 03 Oct 2024 16:20:09 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1swOXR-00000009nU1-1dQu for linux-arm-kernel@lists.infradead.org; Thu, 03 Oct 2024 16:18:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8VFCquFTBw+dL27Xzp2OsRt1sPML0xALYJmjaiCuhhM=; b=rgDhKPeH+AO/mHrnadgpPMChEr qQiB3fiHqtd5YaWhpzNzu6hjJqUwD9Ck4b3xCFp7D8aONfJ8lfADuxAZw0KQax9/R77a+6Qq8i1Rr /6B2yiaVaf8RZP546dJMdV/GU+2jlsn/W5lir1iWF1PheSD94LUld124qIubeluUpfU99iCcU1lZI +pVeHtdBWhBKg+as6Q8K87E/6jmNfLavpzGVFfHNMd3fEFLgFIt9MhnKrNYvJXIsuMakVGmuXU1DA U0qV/IKJpTInhYlaBVipC+66DUyLlWQ6WimTiE3WcLJZV74NCmcl95imnUSOcsjJTTYXlQgFwjPiO +q3lYlQA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:58586) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1swOXK-0000eB-1Y; Thu, 03 Oct 2024 17:18:42 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.96) (envelope-from ) id 1swOXH-0000FO-21; Thu, 03 Oct 2024 17:18:39 +0100 Date: Thu, 3 Oct 2024 17:18:39 +0100 From: "Russell King (Oracle)" To: clingfei Cc: deller@gmx.de, shc_work@mail.ru, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fbdev: clps711x-fb: unregister fb when clps711x_fb_probe register failed Message-ID: References: <20241003161236.3527733-1-clf700383@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241003161236.3527733-1-clf700383@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241003_091849_449077_E48C0201 X-CRM114-Status: UNSURE ( 8.96 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Oct 04, 2024 at 12:12:36AM +0800, clingfei wrote: > When register_framebuffer failed, it jumps out_fb_dealloc_cmap without > calling unregister_framebuffer, which may cause potential memory leak. This looks completely wrong. If register_framebuffer() fails, then the work that register_framebuffer() does internally should be cleaned up and unregister_framebuffer() should not be necessary. The code looks correct as-is to me, so there's no need to patch it. If there is a memory leak, that'll be in register_framebuffer() itself. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!