lkml.org 
[lkml]   [2018]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] taging: fbtft: fix memory leak
There is a typo in the subject.  It should be "Staging" instead of
"taging:".

On Tue, Apr 03, 2018 at 09:14:28PM +0800, Xidong Wang wrote:
> From: Xidong Wang <2711406067@qq.com>
>
> In function fbtft_framebuffer_alloc(), the memory allocated by
> framebuffer_alloc() is not released on the error path that txbuflen > 0
> and txbuf, which holds the return value of devm_kzalloc(), is NULL.
> This will result in a memory leak bug.


The txbuf chunk seems to have been dropped. You're right that it needs
to be fixed as well.

if (txbuflen > 0) {
txbuf = devm_kzalloc(par->info->device, txbuflen, GFP_KERNEL);
if (!txbuf)
- goto alloc_fail;
+ goto err_info;

regards,
dan carpenter

\
 
 \ /
  Last update: 2018-04-03 15:52    [W:0.147 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site