All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kyungmin Park" <kmpark@infradead.org>
To: <linux-mtd@lists.infradead.org>
Subject: RE: [PATCH] [MTD] Make ecclayout static const
Date: Mon, 12 Feb 2007 14:36:28 +0900	[thread overview]
Message-ID: <007201c74e67$c0d94150$c7a3580a@swcenter.sec.samsung.co.kr> (raw)
In-Reply-To: <007101c74e4c$bdb8bbb0$c7a3580a@swcenter.sec.samsung.co.kr>

There's missing one in OneNAND.

>  
> -	for (free = this->ecclayout->oobfree; free->length; ++free) {
> +	free = this->ecclayout->oobfree;
> +	for (i = 0; i < ARRAY_SIZE(this->ecclayout->oobfree); 
> i++, free++) {

After changint "static const" If we only check the free->length, it can
point beyond the ecclayout->oobfree. Since it casts the free pointer and
only check length.
If we only check the array_size, it mis-calculate the readcol & readend in
1KB page OneNAND
So we have to check both array_size and free->length.

for (i = 0; i < ARRAY_SIZE(this->ecclayout->oobfree) && free->length; i++,
free++)

>  
> @@ -1270,19 +1277,22 @@ static int 
> onenand_fill_auto_oob(struct mtd_info *mtd, u_char *oob_buf,
>  				  const u_char *buf, int column, int
> thislen)
>  {
>  
> -	for (free = this->ecclayout->oobfree; free->length; ++free) {
> +	free = this->ecclayout->oobfree;
> +	for (i = 0; i < ARRAY_SIZE(this->ecclayout->oobfree); 
> i++, free++) {

Same as above

After previous mail comments. I will post it again.

Thank you,
Kyungmin Park

  reply	other threads:[~2007-02-12  5:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-12  2:23 Kyungmin Park
2007-02-12  5:36 ` Kyungmin Park [this message]
2007-02-19 13:08 ` Adrian Hunter

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='007201c74e67$c0d94150$c7a3580a@swcenter.sec.samsung.co.kr' \
    --to=kmpark@infradead.org \
    --cc=linux-mtd@lists.infradead.org \
    --subject='RE: [PATCH] [MTD] Make ecclayout static const' \
    /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

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.