]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
staging: fbtft: core: fix potential memory leak in fbtft_probe_common()
authorJianglei Nie <niejianglei2021@163.com>
Wed, 12 Nov 2025 19:22:07 +0000 (20:22 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:03:16 +0000 (14:03 +0100)
commit56296da5e6bf558cd8b91108a356cbd7cd35adbf
tree99e4559d3f872422fa383df596fc28402de0caf7
parent1bdf06f25a497bfb764e53dafb74de2a4b6e330b
staging: fbtft: core: fix potential memory leak in fbtft_probe_common()

[ Upstream commit 47d3949a9b04cbcb0e10abae30c2b53e98706e11 ]

fbtft_probe_common() allocates a memory chunk for "info" with
fbtft_framebuffer_alloc(). When "display->buswidth == 0" is true, the
function returns without releasing the "info", which will lead to a
memory leak.

Fix it by calling fbtft_framebuffer_release() when "display->buswidth
== 0" is true.

Fixes: c296d5f9957c ("staging: fbtft: core support")
Signed-off-by: Jianglei Nie <niejianglei2021@163.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Abdun Nihaal <abdun.nihaal@gmail.com>
Link: https://patch.msgid.link/20251112192235.2088654-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/fbtft/fbtft-core.c