[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241003161236.3527733-1-clf700383@gmail.com>
Date: Fri, 4 Oct 2024 00:12:36 +0800
From: clingfei <clf700383@...il.com>
To: deller@....de
Cc: shc_work@...l.ru,
linux-fbdev@...r.kernel.org,
dri-devel@...ts.freedesktop.org,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
clf700383@...il.com
Subject: [PATCH] fbdev: clps711x-fb: unregister fb when clps711x_fb_probe register failed
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@...il.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
Powered by blists - more mailing lists