[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4BE3ED18.3050202@tuxonice.net>
Date: Fri, 07 May 2010 20:36:08 +1000
From: Nigel Cunningham <nigel@...onice.net>
To: Steven Liu <lingjiujianke@...il.com>
CC: Linus WALLEIJ <linus.walleij@...ricsson.com>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Check kmalloc return value before use the bigrxbuf_virtual
and kfree the bigtxbuf_virtual
Hi.
On 07/05/10 20:04, Steven Liu wrote:
> Check kmalloc return value before use the bigrxbuf_virtual ,when
> bigrxbuf_virtual is NULL, kfree bigtxbuf_virtual and out
>
> Signed-off-by: LiuQi<lingjiujianke@...il.com>
Acked-by: Nigel Cunningham <nigel@...onice.net>
> ---
> arch/arm/mach-u300/dummyspichip.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/mach-u300/dummyspichip.c
> b/arch/arm/mach-u300/dummyspichip.c
> index 5f55012..df19f9b 100644
> --- a/arch/arm/mach-u300/dummyspichip.c
> +++ b/arch/arm/mach-u300/dummyspichip.c
> @@ -64,6 +64,11 @@ static ssize_t dummy_looptest(struct device *dev,
> goto out;
> }
> bigrxbuf_virtual = kmalloc(DMA_TEST_SIZE, GFP_KERNEL);
> + if (bigrxbuf_virtual == NULL) {
> + status = -ENOMEM;
> + kfree(bigtxbuf_virtual);
> + goto out;
> + }
>
> /* Fill TXBUF with some happy pattern */
> memset(bigtxbuf_virtual, 0xAA, DMA_TEST_SIZE);
--
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