lkml.org 
[lkml]   [2015]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] mtd: Add simple read disturb test
From
On Thu, Apr 2, 2015 at 11:33 AM, Richard Weinberger <richard@nod.at> wrote:

> Why? Free()ing a NULL pointer is perfectly fine.
> What did I miss? :)

If the first 'iobuf = kmalloc(mtd->erasesize, GFP_KERNEL);' fails then
you jump to the out label where you call 5 kfree() and then return the
error.

It would be much better just to return the error immediately in this
case and add one label for each allocation error, so that it only
kfree the previous successful allocations.


\
 
 \ /
  Last update: 2015-04-02 17:21    [W:0.258 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site