lkml.org 
[lkml]   [2018]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] staging: mt29f_spinand: fix memory leak while programming pages
On Thu, Aug 02, 2018 at 03:51:30PM +0800, Jheng-Jhong Wu wrote:
> In spinand_program_page(), it uses devm_kzalloc() to allocate memory to
> wbuf dynamically if internal ECC is on, but it doesn't free memory
> allocated to wbuf at the end of this function. Before the spinand device
> is removed and frees memory automatically, programming pages may run many
> times. This leads to a memory leak issue when internal ECC is on.

How is this a memory leak? The memory will be freed when the struct
device is removed from the system. How did you test that there was a
leak?

> Changelog:
>
> v2:
> - use kzalloc()/kfree() to replace devm_kzalloc()/devm_kfree()
> - add some descriptions to commit message

this changelog goes below the --- line.

thanks,

greg k-h

\
 
 \ /
  Last update: 2018-08-02 10:03    [W:0.171 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site