All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Shijie <b32955@freescale.com>
To: Al Cooper <alcooperx@gmail.com>
Cc: linux-mtd@lists.infradead.org, dwmw2@infradead.org
Subject: Re: [PATCH] mtd: mtd_torturetest can cause stack overflows
Date: Tue, 5 Feb 2013 10:05:14 +0800	[thread overview]
Message-ID: <511068DA.4070508@freescale.com> (raw)
In-Reply-To: <1360013390-30179-1-git-send-email-alcooperx@gmail.com>

于 2013年02月05日 05:29, Al Cooper 写道:
> diff --git a/drivers/mtd/tests/mtd_torturetest.c b/drivers/mtd/tests/mtd_torturetest.c
> index c4cde1e..a777cc8 100644
> --- a/drivers/mtd/tests/mtd_torturetest.c
> +++ b/drivers/mtd/tests/mtd_torturetest.c
> @@ -208,7 +208,7 @@ static inline int write_pattern(int ebnum, void *buf)
>   static int __init tort_init(void)
>   {
>   	int err = 0, i, infinite = !cycles_count;
> -	int bad_ebs[ebcnt];
> +	int *bad_ebs;
>
>   	printk(KERN_INFO "\n");
>   	printk(KERN_INFO "=================================================\n");
> @@ -273,6 +273,12 @@ static int __init tort_init(void)
>   		goto out_patt_FF;
>   	}
>
> +	bad_ebs = kmalloc(sizeof(*bad_ebs) * ebcnt, GFP_KERNEL);
I think it's better to use the kcalloc() here.

thanks
Huang Shijie

  reply	other threads:[~2013-02-05  2:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-04 21:29 [PATCH] mtd: mtd_torturetest can cause stack overflows Al Cooper
2013-02-05  2:05 ` Huang Shijie [this message]
2013-02-05 11:20 ` Ezequiel Garcia

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=511068DA.4070508@freescale.com \
    --to=b32955@freescale.com \
    --cc=alcooperx@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-mtd@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.