Re: [PATCH v2] fbdev: ssd1307fb: fix potential page leak in ssd1307fb_probe()

From: Helge Deller

Date: Fri Dec 05 2025 - 05:32:51 EST


On 12/3/25 04:55, Abdun Nihaal wrote:
The page allocated for vmem using __get_free_pages() is not freed on the
error paths after it. Fix that by adding a corresponding __free_pages()
call to the error path.

Fixes: facd94bc458a ("fbdev: ssd1307fb: Allocate page aligned video memory.")
Signed-off-by: Abdun Nihaal <nihaal@xxxxxxxxxxxxxx>
---
Compile tested only. Not tested on hardware.

v1->v2:
- Fix incorrect call to __free_pages with uninitialized values as
pointed out by Helge Deller. Now, the patch uses vmem and vmem_size
which hold valid values at the goto site.

Thanks for catching. I'm sorry I overlooked this in v1.

v1 link: https://lore.kernel.org/all/20251202191225.111661-1-nihaal@xxxxxxxxxxxxxx/

drivers/video/fbdev/ssd1307fb.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
applied.

Thanks!
Helge