]> git.baikalelectronics.ru Git - kernel.git/commit
[MTD] [OneNAND] Fix access the past of the real oobfree array
authorKyungmin Park <kyungmin.park@samsung.com>
Fri, 23 Mar 2007 01:19:52 +0000 (10:19 +0900)
committerDavid Woodhouse <dwmw2@infradead.org>
Wed, 25 Apr 2007 10:09:23 +0000 (11:09 +0100)
commit7ac3a7de644138cc852681b7fe0898b60b7d822c
treeb318886702e697d7f1fbd476851ee03e28ebebc9
parent147735b1ed846e28c4d9fc8e62184d8fd6d60a34
[MTD] [OneNAND] Fix access the past of the real oobfree array

Here it's not the case: all the entries are occupied by
OOB chunks. Therefore, once we get into a loop like

        for (free = this->ecclayout->oobfree; free->length; ++free) {
}

we might end up scanning past the real oobfree array.

Probably the best way out, as the same thing might happen for common NAND
as well, is to check index against MTD_MAX_OOBFREE_ENTRIES.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
drivers/mtd/onenand/onenand_base.c