mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
staging: fbtft: core: fix potential memory leak in fbtft_probe_common()
[ Upstream commit47d3949a9b] 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:c296d5f995("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d6ce96e10e
commit
3cfa3d4b15
@@ -1225,8 +1225,8 @@ int fbtft_probe_common(struct fbtft_display *display,
|
||||
par->pdev = pdev;
|
||||
|
||||
if (display->buswidth == 0) {
|
||||
dev_err(dev, "buswidth is not set\n");
|
||||
return -EINVAL;
|
||||
ret = dev_err_probe(dev, -EINVAL, "buswidth is not set\n");
|
||||
goto out_release;
|
||||
}
|
||||
|
||||
/* write register functions */
|
||||
|
||||
Reference in New Issue
Block a user