Re: [PATCH] staging: mt29f_spinand: fix memory leak while programming pages

From: Jheng-Jhong Wu
Date: Wed Aug 01 2018 - 22:08:23 EST


Dear Â
Dan Carpenter,

I know what Âyou wrote, Âbut Âbefore Âdevice Âis Âremoved Âand Âfreed Âmemory Âautomatically, Âprogramming Âpages may Âdo Âmany Âmany Âtimes.
Assume Âwe Âerase and rewrite a large part of the Âflash, Âthen spinand_program_page() Âmight exhaust Âmemory if memory is not large enough.
In Âfact, ÂOOM Âindeed occured when ÂI Âtested programming Âmulti-pages by mtd_debug tool.
If ÂOOM Âwas not Âcaused Âby Âdevm_kzalloc() in spinand_program_page(), Âwhat Âmay Âexhaust Âmemory?

Best Regards,
âââââââââââââââââââââââââ
Jheng-Jhong Wu (Victor Wu)
E-mail: goodwater.wu@xxxxxxxxx
âââââââââââââââââââââââââ


Dan Carpenter <dan.carpenter@xxxxxxxxxx> æ 2018å8æ1æ éä äå7:45åéï
devm_ resources are freed automatically when the device is removed.
The name devm_ stands for "device" and "managed".

regards,
dan carpenter