Re: [PATCH] Check kmalloc return value before use the buffer
From: Nigel Cunningham
Date: Mon May 10 2010 - 18:08:41 EST
Hi.
On 11/05/10 07:49, Andy Isaacson wrote:
On Fri, May 07, 2010 at 03:17:39PM +0800, Steven Liu wrote:
bigrxbuf_virtual = kmalloc(DMA_TEST_SIZE, GFP_KERNEL);
+ if (bigrxbuf_virtual == NULL) {
+ status = -ENOMEM;
+ kfree(bigtxbuf_virtual);
+ goto out;
+ }
On Sat, May 08, 2010 at 11:27:09AM +1000, Nigel Cunningham wrote:
Acked-by: Linus Walleij<linus.walleij@xxxxxxxxxxxxxx>
Acked-by: Nigel Cunningham<nigel@xxxxxxxxxxxx>
NACK. Don't duplicate kfree(), instead do something like
Yeah... that is a better way of doing it.
Regards,
Nigel
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/