From patchwork Thu Oct 3 16:12:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: clingfei X-Patchwork-Id: 13821250 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 224C8CF34BB for ; Thu, 3 Oct 2024 16:14:46 +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:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Z3WiMbAhFsbgFsMbymS9SFj9ZdJkNGNlqWJ97chhwH4=; b=a7B/R2EM2pvDU2S/RzyGQvYkkp IS0nrq1+pAyshek4EV0HRZV+yWDLOLhoambSlQGR+68vMSpuMfEuYu5rFGqk4fuvQSV0nualh+lj+ qcCl1sMflOQZFcXHftPYiTHemQBa3Uq0Gdqcsux/opGoDzDyFjtNO3/yUZ/txOQwG9gGJK+3f3mgg 0VUQEwshkNe9iGIwb2aKv6MhpDYb5oAs895sOG8NA6Rz2ymW+FWeszijckUPZPofdtAl2oaBJd+oj 0yRcmyzJuylaKSmdjXb3/SEr++pdkhzj1r2VdfuC9ehXm5qOP9I7D4OkZ+SZAc094cG7QhGzlQeFf GU4Ysoqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1swOTK-00000009mHq-467D; Thu, 03 Oct 2024 16:14:34 +0000 Received: from mail-pj1-f66.google.com ([209.85.216.66]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1swOS0-00000009lm0-1ugx for linux-arm-kernel@lists.infradead.org; Thu, 03 Oct 2024 16:13:14 +0000 Received: by mail-pj1-f66.google.com with SMTP id 98e67ed59e1d1-2e0b46df34eso144355a91.3 for ; Thu, 03 Oct 2024 09:13:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727971991; x=1728576791; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Z3WiMbAhFsbgFsMbymS9SFj9ZdJkNGNlqWJ97chhwH4=; b=ffXwD7Jhn48vSDb3pc6Ai8eFsWGFclFyOTeGcffTrwQDWM1idABAiH8beDHdhavhMJ hj0L4NUS4OFFiT8tSAMLdESHnQVnnCD7hOXCyeA90RJR6amBMRbJ4doZ6klVNXdBr1k2 OrRyk5EcD/2ifPH4nOWQbadZpQ71W/1UdjwNCROK5lKeVkpBVSMxMElPGD8YPiG9GLF2 nO/YaPcSTb8k2QqcoEsJBxQCKvbq9gmpzZvgvgKeNBk+AWCzUen7D5zUZjvAgM3Lzute 5NPpFPpkc9KskXVZJwJiad+ThDrTq3gFxCmho7zu/5/uhHUUblVLmrKUFj+7qTJ7ZmoI OFIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727971991; x=1728576791; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Z3WiMbAhFsbgFsMbymS9SFj9ZdJkNGNlqWJ97chhwH4=; b=boIyM9MfeAuuh/tvQc0JEcXJfrgp632jV54C+G6+zkHp+skl8yKBY5NVAYm0u8a4Do ge4pjPjXIpiLGeCYm6UEYSxumdtD8XLkBML3jBnKlgyj2zro0aNTcfbeu3QjdCEZH1s1 XiC4VsE4BEs2RsEm1OIVroEhn+i7hnZMkZl5KH8U6G3Z0S6mEbTcDQUSP2lEHZNphakE Qy7u5Cb/Hd/NE5s5yAJE34xx+4g4rqAtSjWcg2w2gauSQ4xOXxqxJPX6xChf7askWRem CqprIGV2kWyFDkoPH+lFmJHN7eNOAxu9LvWssHbqTqXfEMVCSoZH3qOnXyQmlrfRIlCG 2EyA== X-Forwarded-Encrypted: i=1; AJvYcCV2O7up/dc6j54kLcQqDnQ0IWSvDp6flxH7wTTpUpOeNcRH/ukjAE5Czzr0N3gjFfMcEblA2aRHnkRNov5+yz8j@lists.infradead.org X-Gm-Message-State: AOJu0YzvlLIGROF4CxA3zKr3Gh5EYDKKcQfdWQ+B44j341Lf9Vvmjg9N iD2DZBNp34MUE/YBVeynMs8UH/0+NLKi0N0X0HH50IZcGmRrlLDq X-Google-Smtp-Source: AGHT+IECRTHvTd6P+YA/9SXtKlU5SkB5oDthZt0x/R2Qd3F/NleiAE4FG9DI3RlVuzOcBMfQ4d15Fw== X-Received: by 2002:a17:90a:d50f:b0:2e0:7adb:6380 with SMTP id 98e67ed59e1d1-2e1849be000mr3540656a91.9.1727971990582; Thu, 03 Oct 2024 09:13:10 -0700 (PDT) Received: from user.. ([206.237.119.148]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e1bff53444sm1836316a91.52.2024.10.03.09.13.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 09:13:10 -0700 (PDT) From: clingfei To: deller@gmx.de Cc: 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, clf700383@gmail.com Subject: [PATCH] fbdev: clps711x-fb: unregister fb when clps711x_fb_probe register failed Date: Fri, 4 Oct 2024 00:12:36 +0800 Message-Id: <20241003161236.3527733-1-clf700383@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241003_091312_587481_88E5DFF9 X-CRM114-Status: GOOD ( 10.39 ) 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 When register_framebuffer failed, it jumps out_fb_dealloc_cmap without calling unregister_framebuffer, which may cause potential memory leak. Signed-off-by: clingfei --- drivers/video/fbdev/clps711x-fb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/clps711x-fb.c b/drivers/video/fbdev/clps711x-fb.c index 9e3df1df5ac4..69db40a7a361 100644 --- a/drivers/video/fbdev/clps711x-fb.c +++ b/drivers/video/fbdev/clps711x-fb.c @@ -328,10 +328,11 @@ static int clps711x_fb_probe(struct platform_device *pdev) ret = register_framebuffer(info); if (ret) - goto out_fb_dealloc_cmap; + goto out_fb_unregister; return 0; +out_fb_unregister: unregister_framebuffer(info); out_fb_dealloc_cmap: