lkml.org 
[lkml]   [2024]   [Apr]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] staging: fbtft: core: fix potential memory leak in fbtft_probe_common()
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 calling fbtft_framebuffer_release() when "display->buswidth
> == 0" is true.

Fixes tag?

..

> if (display->buswidth == 0) {
> dev_err(dev, "buswidth is not set\n");
> + fbtft_framebuffer_release(info);
> return -EINVAL;

ret = dev_err_probe(dev, -EINVAL, "buswidth is not set\n");
goto out_release;

> }

--
With Best Regards,
Andy Shevchenko



\
 
 \ /
  Last update: 2024-04-04 18:35    [W:0.039 / U:1.324 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site