]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
staging: fbtft: fix potential memory leak in fbtft_framebuffer_alloc()
authorAbdun Nihaal <abdun.nihaal@gmail.com>
Thu, 26 Jun 2025 17:24:10 +0000 (22:54 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 10:08:42 +0000 (12:08 +0200)
commitb31cf6f7716a5d3e4461763f32d812acdaec6e74
tree137f9de13201a6e5b5cb1a7cabfb4fb366953879
parent6031a54f4eac921efe6122a561d44df89b37f2d4
staging: fbtft: fix potential memory leak in fbtft_framebuffer_alloc()

[ Upstream commit eb2cb7dab60f9be0b435ac4a674255429a36d72c ]

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@gmail.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20250626172412.18355-1-abdun.nihaal@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/fbtft/fbtft-core.c