[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <551D58B2.2050302@nod.at>
Date: Thu, 02 Apr 2015 16:56:50 +0200
From: Richard Weinberger <richard@....at>
To: Fabio Estevam <festevam@...il.com>
CC: Brian Norris <computersforpeace@...il.com>,
"linux-mtd@...ts.infradead.org" <linux-mtd@...ts.infradead.org>,
David Woodhouse <dwmw2@...radead.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mtd: Add simple read disturb test
Am 02.04.2015 um 16:45 schrieb Fabio Estevam:
> On Thu, Apr 2, 2015 at 11:33 AM, Richard Weinberger <richard@....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.
It is not *much* better. It is just a matter of taste.
Thanks,
//richard
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists