Re: [PATCH] staging: fbtft: core: fix potential memory leak in fbtft_probe_common()

2024-04-04 Thread Andy Shevchenko
On Wed, Sep 28, 2022 at 02:23:01PM +0800, Jianglei Nie wrote: > 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

[PATCH] staging: fbtft: core: fix potential memory leak in fbtft_probe_common()

2022-09-28 Thread Jianglei Nie
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.