From: Nigel Cunningham <nigel@tuxonice.net>
To: Steven Liu <lingjiujianke@gmail.com>
Cc: Linus WALLEIJ <linus.walleij@stericsson.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Check kmalloc return value before use the bigrxbuf_virtual and kfree the bigtxbuf_virtual
Date: Fri, 07 May 2010 20:36:08 +1000 [thread overview]
Message-ID: <4BE3ED18.3050202@tuxonice.net> (raw)
In-Reply-To: <x2ybd0d95d71005070304wf9c7235eqedf0d0c37dffe316@mail.gmail.com>
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@gmail.com>
Acked-by: Nigel Cunningham <nigel@tuxonice.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);
prev parent reply other threads:[~2010-05-07 10:36 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-07 10:04 [PATCH] Check kmalloc return value before use the bigrxbuf_virtual and kfree the bigtxbuf_virtual Steven Liu
2010-05-07 10:36 ` Nigel Cunningham [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4BE3ED18.3050202@tuxonice.net \
--to=nigel@tuxonice.net \
--cc=lingjiujianke@gmail.com \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox