Re: [PATCH 1/1] taging: fbtft: fix memory leak

From: Greg Kroah-Hartman
Date: Tue Apr 03 2018 - 09:29:40 EST


On Tue, Apr 03, 2018 at 09:14:28PM +0800, Xidong Wang wrote:
> From: Xidong Wang <2711406067@xxxxxx>
>
> 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.
>
> Signed-off-by: Xidong Wang <2711406067@xxxxxx>
> ---
> drivers/staging/fbtft/fbtft-core.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)

<formletter>

This is not the correct way to submit patches for inclusion in the
stable kernel tree. Please read:
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
for how to do this properly.

</formletter>