linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: clingfei <clf700383@gmail.com>
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	[thread overview]
Message-ID: <20241003161236.3527733-1-clf700383@gmail.com> (raw)

When register_framebuffer failed, it jumps out_fb_dealloc_cmap without
calling unregister_framebuffer, which may cause potential memory leak.

Signed-off-by: clingfei <clf700383@gmail.com>
---
 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:
-- 
2.34.1


             reply	other threads:[~2024-10-03 16:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-03 16:12 clingfei [this message]
2024-10-03 16:18 ` [PATCH] fbdev: clps711x-fb: unregister fb when clps711x_fb_probe register failed Russell King (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241003161236.3527733-1-clf700383@gmail.com \
    --to=clf700383@gmail.com \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shc_work@mail.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).