[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250626172412.18355-1-abdun.nihaal@gmail.com>
Date: Thu, 26 Jun 2025 22:54:10 +0530
From: Abdun Nihaal <abdun.nihaal@...il.com>
To: andy@...nel.org
Cc: Abdun Nihaal <abdun.nihaal@...il.com>,
gregkh@...uxfoundation.org,
lorenzo.stoakes@...cle.com,
tzimmermann@...e.de,
riyandhiman14@...il.com,
willy@...radead.org,
notro@...nnes.org,
thomas.petazzoni@...e-electrons.com,
dri-devel@...ts.freedesktop.org,
linux-fbdev@...r.kernel.org,
linux-staging@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: [PATCH] staging: fbtft: fix potential memory leak in fbtft_framebuffer_alloc()
In the error paths after fb_info structure is successfully allocated,
the memory allocated in fb_deferred_io_init() for info->pagerefs is not
freed. Fix that by adding the cleanup function on the error path.
Fixes: c296d5f9957c ("staging: fbtft: core support")
Signed-off-by: Abdun Nihaal <abdun.nihaal@...il.com>
---
This patch is compile tested only. Not tested on real hardware.
Bug was found using our prototype static analysis tool.
drivers/staging/fbtft/fbtft-core.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
index da9c64152a60..39bced400065 100644
--- a/drivers/staging/fbtft/fbtft-core.c
+++ b/drivers/staging/fbtft/fbtft-core.c
@@ -692,6 +692,7 @@ struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,
return info;
release_framebuf:
+ fb_deferred_io_cleanup(info);
framebuffer_release(info);
alloc_fail:
--
2.43.0
Powered by blists - more mailing lists